opnsense-src/sys/conf
John Baldwin fdce57a042 Add an EARLY_AP_STARTUP option to start APs earlier during boot.
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
2016-05-14 18:22:52 +00:00
..
config.mk
dtb.mk
files Remove sh accidentally added to dependency lines in r299684 2016-05-13 18:54:48 +00:00
files.amd64 Update file list for sfgxe(4) again and hey, my amd64 kernels compile again. 2016-05-14 08:55:15 +00:00
files.arm Move arm's devmap to some generic place, so it can be used 2016-04-26 11:53:37 +00:00
files.arm64 Move arm's devmap to some generic place, so it can be used 2016-04-26 11:53:37 +00:00
files.i386 hyperv: Deprecate HYPERV option by moving Hyper-V IDT vector into vmbus 2016-04-15 02:20:18 +00:00
files.mips Implement FBT provider (MD part) for DTrace on MIPS. 2016-05-05 13:54:50 +00:00
files.pc98 Move i386/i386/autoconf.c to sys/x86/x86 and use it on both amd64 and i386. 2016-04-03 23:03:54 +00:00
files.powerpc Fix PowerPC LINT build after r297392 2016-04-01 09:07:18 +00:00
files.riscv o Add device tree files and kernel configuration files 2016-04-26 13:22:08 +00:00
files.sparc64 simplify compile-time default keyboard map generation 2016-03-28 19:51:45 +00:00
kern.mk
kern.opts.mk Remove the old depend (mkdep) code and make FAST_DEPEND the one true way. 2016-03-30 23:50:23 +00:00
kern.post.mk Revert r298357 2016-04-20 22:41:19 +00:00
kern.pre.mk Remove the old depend (mkdep) code and make FAST_DEPEND the one true way. 2016-03-30 23:50:23 +00:00
kmod.mk After r299241, which added bhnd(4), use sh to run the shell scripts for 2016-05-13 16:35:37 +00:00
kmod_syms.awk
ldscript.amd64
ldscript.arm
ldscript.arm64
ldscript.i386
ldscript.mips
ldscript.mips.cfe
ldscript.mips.mips64
ldscript.mips.octeon1
ldscript.powerpc
ldscript.powerpc64
ldscript.riscv
ldscript.sparc64
Makefile.amd64
Makefile.arm
Makefile.arm64
Makefile.i386
Makefile.mips
Makefile.pc98
Makefile.powerpc
Makefile.riscv
Makefile.sparc64
makeLINT.mk
makeLINT.sed
newvers.sh newvers.sh: rationalize licence condition numbering 2016-04-07 20:30:46 +00:00
NOTES Add an EARLY_AP_STARTUP option to start APs earlier during boot. 2016-05-14 18:22:52 +00:00
options Add an EARLY_AP_STARTUP option to start APs earlier during boot. 2016-05-14 18:22:52 +00:00
options.amd64 hyperv: Deprecate HYPERV option by moving Hyper-V IDT vector into vmbus 2016-04-15 02:20:18 +00:00
options.arm Add support for Allwinner H3 SoC. 2016-05-13 18:20:54 +00:00
options.arm64
options.i386 hyperv: Deprecate HYPERV option by moving Hyper-V IDT vector into vmbus 2016-04-15 02:20:18 +00:00
options.mips Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
options.pc98
options.powerpc
options.riscv Revert r298477 ("Clear the DDR memory"). 2016-04-25 13:20:57 +00:00
options.sparc64
systags.sh
WITHOUT_SOURCELESS
WITHOUT_SOURCELESS_HOST
WITHOUT_SOURCELESS_UCODE