freebsd kernel with SKQ
Go to file
jhb bcc5b0c55d 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
bin Rename getline with get_line to avoid collision with getline(3) 2016-05-10 11:11:23 +00:00
cddl Fix DTrace test ATF wrapper generation. 2016-05-10 20:25:49 +00:00
contrib MFV r299716: file 5.27 2016-05-14 08:52:37 +00:00
crypto libkrb5: Fix potential double-free 2016-05-11 23:25:59 +00:00
etc iconvctl(3): remove superfluous NULL pointer tests 2016-05-14 00:35:35 +00:00
gnu Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
include stdio.h: Fix function-type typedef style and use _types.h __ssize_t 2016-05-12 22:13:12 +00:00
kerberos5
lib Add thr*.2 and _umtx_op.2 manpages to the build. 2016-05-14 09:43:28 +00:00
libexec Declare line[] in the outermost scope of retrieve() instead of 2016-05-13 01:52:41 +00:00
release Document r296633, OpenSSH updated to 7.2p2. 2016-05-12 19:32:40 +00:00
rescue
sbin Check for socket creation success before calling bind(). 2016-05-12 05:43:54 +00:00
secure Regen x86 assembly files for r299480. 2016-05-11 20:11:21 +00:00
share Add myself to the list of src committers. I've never been added it 2016-05-12 20:04:09 +00:00
sys Add an EARLY_AP_STARTUP option to start APs earlier during boot. 2016-05-14 18:22:52 +00:00
targets
tests kern_descrip_test: Fix trivial buffer overrun with readlink(2) 2016-05-12 03:44:29 +00:00
tools Only install etc/rc.d/{rfcomm_pppd_server,sdpd} if MK_BLUETOOTH != no 2016-05-06 09:18:09 +00:00
usr.bin Always return either a dynamically allocated string or NULL from 2016-05-13 06:15:05 +00:00
usr.sbin Undo the bogus gethostname() change from r299709. 2016-05-14 04:29:13 +00:00
.arcconfig
.arclint
COPYRIGHT
LOCKS
MAINTAINERS
Makefile
Makefile.inc1 Support libsoft for restage. 2016-05-13 17:44:20 +00:00
Makefile.libcompat
ObsoleteFiles.inc Misc. build: minor spelling fixes. 2016-05-03 22:01:48 +00:00
README
UPDATING Change the default installation directory for modules to /boot/modules. 2016-05-10 22:32:23 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree.  See build(7)
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The `buildkernel` and `installkernel` targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process.  See build(7), config(8),
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
for more information.

Note: If you want to build and install the kernel with the
`buildkernel` and `installkernel` targets, you might need to build
world before.  More information is available in the handbook.

The kernel configuration files reside in the sys/<arch>/conf
sub-directory.  GENERIC is the default configuration used in release builds.
NOTES contains entries and documentation for all possible
devices, not just those commonly used.


Source Roadmap:
---------------

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html