freebsd with flexible iflib nic queues
Go to file
John Baldwin 875b66a05b Expand the scope of the sysctllock sx lock to protect the sysctl tree itself.
Back in 1.1 of kern_sysctl.c the sysctl() routine wired the "old" userland
buffer for most sysctls (everything except kern.vnode.*).  I think to prevent
issues with wiring too much memory it used a 'memlock' to serialize all
sysctl(2) invocations, meaning that only one user buffer could be wired at
a time.  In 5.0 the 'memlock' was converted to an sx lock and renamed to
'sysctl lock'.  However, it still only served the purpose of serializing
sysctls to avoid wiring too much memory and didn't actually protect the
sysctl tree as its name suggested.  These changes expand the lock to actually
protect the tree.

Later on in 5.0, sysctl was changed to not wire buffers for requests by
default (sysctl_handle_opaque() will still wire buffers larger than a single
page, however).  As a result, user buffers are no longer wired as often.
However, many sysctl handlers still wire user buffers, so it is still
desirable to serialize userland sysctl requests.  Kernel sysctl requests
are allowed to run in parallel, however.

- Expose sysctl_lock()/sysctl_unlock() routines to exclusively lock the
  sysctl tree for a few places outside of kern_sysctl.c that manipulate
  the sysctl tree directly including the kernel linker and vfs_register().
- sysctl_register() and sysctl_unregister() require the caller to lock
  the sysctl lock using sysctl_lock() and sysctl_unlock().  The rest of
  the public sysctl API manage the locking internally.
- Add a locked variant of sysctl_remove_oid() for internal use so that
  external uses of the API do not need to be aware of locking requirements.
- The kernel linker no longer needs Giant when manipulating the sysctl
  tree.
- Add a missing break to the loop in vfs_register() so that we stop looking
  at the sysctl MIB once we have changed it.

MFC after:	1 month
2009-02-06 14:51:32 +00:00
bin Before this fix, pax would stop the restore sequence for 2009-02-01 06:15:46 +00:00
cddl Correct the sense of the "use32" terenary operator so that it uses 2009-01-16 22:16:54 +00:00
contrib - Remove non-existing reference 2009-01-30 15:43:55 +00:00
crypto Prevent cross-site forgery attacks on lukemftpd(8) due to splitting 2009-01-07 20:17:55 +00:00
etc Check for NOAUTO on child interfaces (eg wlanX) so they can be created via 2009-02-04 18:20:27 +00:00
games netcat is "now" in base, so point people at nc(1) instead of the port. 2009-01-12 19:17:43 +00:00
gnu For files not named on the command line, only the basename is compared 2009-01-30 00:22:08 +00:00
include Also un-split _PATH_STDPATH for grepability. 2009-02-01 00:50:46 +00:00
kerberos5 Add strndup(3) prototype to string.h. 2008-12-08 21:04:24 +00:00
lib Standardize the various prison_foo_ip[46] functions and prison_if to 2009-02-05 14:06:09 +00:00
libexec o Fix typo: indentical -> identical. 2009-01-30 09:42:25 +00:00
release Note new fetch if-modified-since support in the userland section, and 2009-01-09 03:52:12 +00:00
rescue Take a moment to tidy some white space while I'm here. No functional 2008-09-13 19:56:37 +00:00
sbin Set NFSMNT_ACDIRMAX flag in fallback_mount() function. 2009-02-06 07:47:53 +00:00
secure Enable getaudit_addr(2) for sshd again. This will un-break the subject 2008-11-30 15:35:24 +00:00
share Remove the assertive KA_HELD and KA_UNHELD as long as they are dangerous, 2009-02-05 15:09:04 +00:00
sys Expand the scope of the sysctllock sx lock to protect the sysctl tree itself. 2009-02-06 14:51:32 +00:00
tools for adhoc and ahdemo modes try to find the "bss node": use the bssid 2009-02-05 23:15:39 +00:00
usr.bin Clenup code a bit and do not call fork(2) before dameon(3) where not needed. 2009-02-04 22:04:06 +00:00
usr.sbin Make config -x <kernel> only return non-zero characters, 2009-02-06 00:50:21 +00:00
COPYRIGHT Bump the odometer of the years. A little early this year for 7.1R. 2008-12-30 04:46:25 +00:00
LOCKS Update LOCKS syntax. 2008-06-05 19:47:58 +00:00
MAINTAINERS Update description text 2008-06-06 21:32:01 +00:00
Makefile Permit digits at the beginning and end of kernel config file names for 2008-12-27 15:07:51 +00:00
Makefile.inc1 Implement an idea from Sam Leffler: 2009-01-23 18:23:16 +00:00
ObsoleteFiles.inc Reflect adding_user.8 -> adding_user.7 rename 2009-02-03 20:46:05 +00:00
README
UPDATING Remove the single global unlocked route cache ip6_forward_rt 2009-02-01 21:11:08 +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, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The ``world''
target should only be used in cases where the source tree has not
changed from the currently running version.  See:
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, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
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 sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

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.

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