freebsd-nq/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 Reduce duplicated logic from r291744. 2016-03-12 22:21:14 +00:00
dtb.mk Do as r289391 did for share/mk and make installing to a non-existent directory 2015-10-17 05:49:07 +00:00
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 We only support GCC 4.8 for these flags. 2016-03-13 19:17:48 +00:00
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_syms.awk
kmod.mk After r299241, which added bhnd(4), use sh to run the shell scripts for 2016-05-13 16:35:37 +00:00
ldscript.amd64 amd64: set the correct LMA values 2015-06-26 07:12:17 +00:00
ldscript.arm
ldscript.arm64 Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
ldscript.i386
ldscript.mips
ldscript.mips.cfe
ldscript.mips.mips64
ldscript.mips.octeon1
ldscript.powerpc Refactor PowerPC (especially AIM) init sequence to be less baroque. 2015-01-18 18:32:43 +00:00
ldscript.powerpc64 Fix build with new binutils. This gets a working kernel with GCC 5.2 and 2015-11-29 06:40:09 +00:00
ldscript.riscv Welcome the RISC-V 64-bit kernel. 2016-01-29 15:12:31 +00:00
ldscript.sparc64
Makefile.amd64 Clang's 3.5 integrated assembler now handles these files correctly (it 2015-01-05 12:28:22 +00:00
Makefile.arm ARM: All remaining functions in cpufunc_asm_arm10.S are identical with 2016-02-02 14:53:34 +00:00
Makefile.arm64 Build changes that allow the modules on arm64. 2015-10-08 17:42:08 +00:00
Makefile.i386 Clang's 3.5 integrated assembler now handles these files correctly (it 2015-01-05 12:28:22 +00:00
Makefile.mips Revert this change. It broke the trampoline build. Until I'm sure 2015-12-21 20:36:01 +00:00
Makefile.pc98 Fix kernel build ${MACHINE} path 2015-04-16 22:34:10 +00:00
Makefile.powerpc Make 32-bit PowerPC kernels, like 64-bit PowerPC kernels, position-independent 2015-03-07 20:14:46 +00:00
Makefile.riscv Add support for ddb(4). 2016-03-10 15:51:43 +00:00
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 Add the SOC_HISI_HI6220 option. This will be used to enable drivers for 2015-08-26 18:09:17 +00:00
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 Reduce diffs against i386. 2014-10-04 05:03:39 +00:00
options.powerpc Add support for new LAW registers in QorIQ SoCs. 2015-11-18 01:54:19 +00:00
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 Add nodevice iwmfw to WITHOUT_SOURCELESS_UCODE. 2015-08-08 20:45:47 +00:00