Mono Gateway (NXP LS1046A) fork of OPNsense src: DPAA/LS1046A kernel support, rebased on upstream release tags
Find a file
Attilio Rao 047dd67e96 Optimize lockmgr in order to get rid of the pool mutex interlock, of the
state transitioning flags and of msleep(9) callings.
Use, instead, an algorithm very similar to what sx(9) and rwlock(9)
alredy do and direct accesses to the sleepqueue(9) primitive.

In order to avoid writer starvation a mechanism very similar to what
rwlock(9) uses now is implemented, with the correspective per-thread
shared lockmgrs counter.

This patch also adds 2 new functions to lockmgr KPI: lockmgr_rw() and
lockmgr_args_rw().  These two are like the 2 "normal" versions, but they
both accept a rwlock as interlock.  In order to realize this, the general
lockmgr manager function "__lockmgr_args()" has been implemented through
the generic lock layer. It supports all the blocking primitives, but
currently only these 2 mappers live.

The patch drops the support for WITNESS atm, but it will be probabilly
added soon. Also, there is a little race in the draining code which is
also present in the current CVS stock implementation: if some sharers,
once they wakeup, are in the runqueue they can contend the lock with
the exclusive drainer.  This is hard to be fixed but the now committed
code mitigate this issue a lot better than the (past) CVS version.
In addition assertive KA_HELD and KA_UNHELD have been made mute
assertions because they are dangerous and they will be nomore supported
soon.

In order to avoid namespace pollution, stack.h is splitted into two
parts: one which includes only the "struct stack" definition (_stack.h)
and one defining the KPI.  In this way, newly added _lockmgr.h can
just include _stack.h.

Kernel ABI results heavilly changed by this commit (the now committed
version of "struct lock" is a lot smaller than the previous one) and
KPI results broken by lockmgr_rw() / lockmgr_args_rw() introduction,
so manpages and __FreeBSD_version will be updated accordingly.

Tested by:      kris, pho, jeff, danger
Reviewed by:    jeff
Sponsored by:   Google, Summer of Code program 2007
2008-04-06 20:08:51 +00:00
bin Turn a tab into a space. This fixes a misalignment for ls -l. 2008-04-05 21:26:25 +00:00
cddl Remove options MK_LIBKSE and DEFAULT_THREAD_LIB now that we no longer 2008-03-29 17:44:40 +00:00
contrib Add an -O option to disable TCP options, for protocol testing purposes. 2008-04-01 13:54:24 +00:00
crypto Fix the Xlist so it actually works with 'tar -X', and update the upgrade 2008-02-06 23:14:24 +00:00
etc Back out revision 1.6, the addition of "BEFORE: mountcritremote". 2008-04-02 19:29:16 +00:00
games Put back the quote from Chinggis Khan removed in rev. 1.259. 2008-04-03 10:22:56 +00:00
gnu Change kgdb_parse() to use wrapped versions of parse_expression() and 2008-03-29 17:46:03 +00:00
include Correct the prototype for the faccessat(). 2008-04-01 10:49:06 +00:00
kerberos5 While checking over the libraries for 7.0-REL Kris found the following 2007-11-20 04:20:32 +00:00
lib On i386, don't try to do network-type stuff if the device name is'nt pxeN. 2008-04-05 15:03:29 +00:00
libexec MFp4: Add mips support for dynamic linking. 2008-04-04 20:59:26 +00:00
release New release notes: ULE default (+MFC), aac(4) >2TB volume support 2008-04-05 18:11:39 +00:00
rescue Adding glabel alias killed gpart alias; fix it. 2008-03-29 13:15:33 +00:00
sbin - Normalize usage(), add "ddb pathname" syntax. 2008-04-04 07:31:43 +00:00
secure For users of FreeBSD <= 6.2 we recommend during the x.org 7.x upgrade 2008-03-05 20:58:15 +00:00
share MFp4 (mips2-jnpr): 2008-04-04 21:12:40 +00:00
sys Optimize lockmgr in order to get rid of the pool mutex interlock, of the 2008-04-06 20:08:51 +00:00
tools Correct typo. 2008-04-05 15:51:14 +00:00
usr.bin MFp4(mips2-jnpr): 2008-04-04 21:35:13 +00:00
usr.sbin Call listen(2) on bound tcp sockets before passing them to svc_tli_create. 2008-04-06 13:52:17 +00:00
COPYRIGHT Happy new year 2008! 2007-12-31 22:09:19 +00:00
LOCKS Once the release goes out, RELENG_7_* will need approval from so@. 2008-01-24 22:07:03 +00:00
MAINTAINERS OLDCARD is gone, release imp's lock. 2008-01-26 21:58:52 +00:00
Makefile Double up the necessary size of /usr/obj to 800MB 2008-03-31 13:32:55 +00:00
Makefile.inc1 Remove options MK_LIBKSE and DEFAULT_THREAD_LIB now that we no longer 2008-03-29 17:44:40 +00:00
ObsoleteFiles.inc Add pkg_check and pkg_sign to ObsoleteFiles.inc 2008-04-01 11:05:26 +00:00
README Simply running ``make world'' will bomb unless you dig up the 2006-06-07 03:33:48 +00:00
UPDATING - Add an UPDATING entry about the removal of KSE. 2008-03-12 09:48:42 +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