fdce57a042
Currently, Application Processors (non-boot CPUs) are started by MD code at SI_SUB_CPU, but they are kept waiting in a "pen" until SI_SUB_SMP at which point they are released to run kernel threads. SI_SUB_SMP is one of the last SYSINIT levels, so APs don't enter the scheduler and start running threads until fairly late in the boot. This change moves SI_SUB_SMP up to just before software interrupt threads are created allowing the APs to start executing kernel threads much sooner (before any devices are probed). This allows several initialization routines that need to perform initialization on all CPUs to now perform that initialization in one step rather than having to defer the AP initialization to a second SYSINIT run at SI_SUB_SMP. It also permits all CPUs to be available for handling interrupts before any devices are probed. This last feature fixes a problem on with interrupt vector exhaustion. Specifically, in the old model all device interrupts were routed onto the boot CPU during boot. Later after the APs were released at SI_SUB_SMP, interrupts were redistributed across all CPUs. However, several drivers for multiqueue hardware allocate N interrupts per CPU in the system. In a system with many CPUs, just a few drivers doing this could exhaust the available pool of interrupt vectors on the boot CPU as each driver was allocating N * mp_ncpu vectors on the boot CPU. Now, drivers will allocate interrupts on their desired CPUs during boot meaning that only N interrupts are allocated from the boot CPU instead of N * mp_ncpu. Some other bits of code can also be simplified as smp_started is now true much earlier and will now always be true for these bits of code. This removes the need to treat the single-CPU boot environment as a special case. As a transition aid, the new behavior is available under a new kernel option (EARLY_AP_STARTUP). This will allow the option to be turned off if need be during initial testing. I plan to enable this on x86 by default in a followup commit in the next few days and to have all platforms moved over before 11.0. Once the transition is complete, the option will be removed along with the !EARLY_AP_STARTUP code. These changes have only been tested on x86. Other platform maintainers are encouraged to port their architectures over as well. The main things to check for are any uses of smp_started in MD code that can be simplified and SI_SUB_SMP SYSINITs in MD code that can be removed in the EARLY_AP_STARTUP case (e.g. the interrupt shuffling). PR: kern/199321 Reviewed by: markj, gnn, kib Sponsored by: Netflix |
||
---|---|---|
.. | ||
altq | ||
bpf_buffer.c | ||
bpf_buffer.h | ||
bpf_filter.c | ||
bpf_jitter.c | ||
bpf_jitter.h | ||
bpf_zerocopy.c | ||
bpf_zerocopy.h | ||
bpf.c | ||
bpf.h | ||
bpfdesc.h | ||
bridgestp.c | ||
bridgestp.h | ||
ethernet.h | ||
fddi.h | ||
firewire.h | ||
flowtable.c | ||
flowtable.h | ||
ieee8023ad_lacp.c | ||
ieee8023ad_lacp.h | ||
ieee_oui.h | ||
if_arc.h | ||
if_arcsubr.c | ||
if_arp.h | ||
if_atm.h | ||
if_atmsubr.c | ||
if_bridge.c | ||
if_bridgevar.h | ||
if_clone.c | ||
if_clone.h | ||
if_dead.c | ||
if_debug.c | ||
if_disc.c | ||
if_dl.h | ||
if_edsc.c | ||
if_enc.c | ||
if_enc.h | ||
if_epair.c | ||
if_ethersubr.c | ||
if_fddisubr.c | ||
if_fwsubr.c | ||
if_gif.c | ||
if_gif.h | ||
if_gre.c | ||
if_gre.h | ||
if_iso88025subr.c | ||
if_lagg.c | ||
if_lagg.h | ||
if_llatbl.c | ||
if_llatbl.h | ||
if_llc.h | ||
if_loop.c | ||
if_me.c | ||
if_media.c | ||
if_media.h | ||
if_mib.c | ||
if_mib.h | ||
if_pflog.h | ||
if_pfsync.h | ||
if_sppp.h | ||
if_spppfr.c | ||
if_spppsubr.c | ||
if_stf.c | ||
if_tap.c | ||
if_tap.h | ||
if_tapvar.h | ||
if_tun.c | ||
if_tun.h | ||
if_types.h | ||
if_var.h | ||
if_vlan_var.h | ||
if_vlan.c | ||
if_vxlan.c | ||
if_vxlan.h | ||
if.c | ||
if.h | ||
ifq.h | ||
iso88025.h | ||
netisr_internal.h | ||
netisr.c | ||
netisr.h | ||
netmap_user.h | ||
netmap.h | ||
paravirt.h | ||
pfil.c | ||
pfil.h | ||
pfkeyv2.h | ||
pfvar.h | ||
ppp_defs.h | ||
radix_mpath.c | ||
radix_mpath.h | ||
radix.c | ||
radix.h | ||
raw_cb.c | ||
raw_cb.h | ||
raw_usrreq.c | ||
route_var.h | ||
route.c | ||
route.h | ||
rss_config.c | ||
rss_config.h | ||
rtsock.c | ||
sff8436.h | ||
sff8472.h | ||
slcompress.c | ||
slcompress.h | ||
toeplitz.c | ||
toeplitz.h | ||
vnet.c | ||
vnet.h |