mirror of
https://github.com/opnsense/src.git
synced 2026-05-27 20:02:43 -04:00
schedinit_ap() sets up an AP for a later call to sched_throw(NULL).
Currently, ULE sets up some pcpu bits and fixes the idlethread lock with
a call to sched_throw(NULL); this results in a window where curthread is
setup in platforms' init_secondary(), but it has the wrong td_lock.
Typical platform AP startup procedure looks something like:
- Setup curthread
- ... other stuff, including cpu_initclocks_ap()
- Signal smp_started
- sched_throw(NULL) to enter the scheduler
cpu_initclocks_ap() may have callouts to process (e.g., nvme) and
attempt to sched_add() for this AP, but this attempt fails because
of the noted violated assumption leading to locking heartburn in
sched_setpreempt().
Interrupts are still disabled until cpu_throw() so we're not really at
risk of being preempted -- just let the scheduler in on it a little
earlier as part of setting up curthread.
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| autoconf.c | ||
| bcopy.S | ||
| bus_space_generic.c | ||
| busdma_machdep.c | ||
| cache.c | ||
| cache_mipsNN.c | ||
| cpu.c | ||
| db_disasm.c | ||
| db_interface.c | ||
| db_trace.c | ||
| dump_machdep.c | ||
| elf_machdep.c | ||
| elf_trampoline.c | ||
| exception.S | ||
| fp.S | ||
| freebsd32_machdep.c | ||
| gdb_machdep.c | ||
| genassym.c | ||
| inckern.S | ||
| intr_machdep.c | ||
| libkern_machdep.c | ||
| locore.S | ||
| machdep.c | ||
| mem.c | ||
| minidump_machdep.c | ||
| mips_pic.c | ||
| mp_machdep.c | ||
| mpboot.S | ||
| nexus.c | ||
| octeon_cop2.c | ||
| octeon_cop2_swtch.S | ||
| ofw_machdep.c | ||
| pm_machdep.c | ||
| pmap.c | ||
| ptrace_machdep.c | ||
| sc_machdep.c | ||
| stack_machdep.c | ||
| stdatomic.c | ||
| support.S | ||
| swtch.S | ||
| sys_machdep.c | ||
| tick.c | ||
| tlb.c | ||
| trap.c | ||
| uio_machdep.c | ||
| uma_machdep.c | ||
| vm_machdep.c | ||