freebsd kernel with SKQ
Go to file
Andriy Gapon 58f61ce4eb opensolaris cyclic: fix deadlock and make a little bit closer to upstream
The dealock was caused in the following way:
- thread T1 on CPU C1 holds a spin mutex, IPIs CPU C2 and waits for the
  IPI to be handled
- C2 executes timer interrupt filter, thus has interrupts disabled, and
  gets blocked on the spin mutex held by T1
The problem seems to have been introduced by simplifications made to
OpenSolaris code during porting.
The problem is fixed by reorganizing the code to more closely resemble
the upstream version.  Interrupt filter (cyclic_fire) now doesn't
acquire any locks, all per-CPU data accesses are performed on a
target CPU with preemption and interrupts disabled thus precluding
concurrent access to the data.
cyp_mtx spin mutex is used to disable preemtion and interrupts; it's not
used for classical mutual exclusion, because xcall already serializes
calls to a CPU.  It's an emulation of OpenSolaris
cyb_set_level(CY_HIGH_LEVEL) call, the spin mutexes could probably be
reduced to just a spinlock_enter()/_exit() pair.

Diff with upstream version is now reduced by ~500 lines, however it still
remains quite large - many things that are not needed (at the moment) or
are irrelevant on FreeBSD were simply ripped out during porting.
Examples of such things:
- support for CPU onlining/offlining
- support for suspend/resume
- support for running callouts at soft interrupt levels
- support for callout rebinding from CPU to CPU
- support for CPU partitions

Tested by:	Artem Belevich <fbsdlist@src.cx>
MFC after:	3 weeks
X-MFC with:	r216252
2010-12-07 12:25:26 +00:00
bin sh: Improve internal-representation-to-text code to avoid binary output. 2010-12-06 23:49:27 +00:00
cddl Do not lint code beyond necessity (with apologies to Wiliam of Ockham). 2010-11-18 16:32:52 +00:00
contrib traceroute(8): make WARNS=3 clean 2010-12-04 14:19:27 +00:00
crypto Merge OpenSSL 0.9.8q into head. 2010-12-03 22:59:54 +00:00
etc Add a sync to the shutdown step. In the common case this will be harmless 2010-11-25 18:20:28 +00:00
games Drop advertising clause in manpages. It was done a long time ago 2010-12-06 19:12:51 +00:00
gnu Unbreak amd64<->i386 cross builds. 2010-12-02 17:36:47 +00:00
include Sync with OpenBSD, primarily better signal and terminal handling. 2010-11-13 10:38:06 +00:00
kerberos5 Fix a typo. 2010-01-09 18:53:03 +00:00
lib Another minor nit: Make sure the constant here is a float so the compiler 2010-12-07 03:29:36 +00:00
libexec Fix double ;; 2010-12-06 10:24:06 +00:00
release move the initialization of BINMAKE earler, so it is 2010-11-12 12:48:41 +00:00
rescue Break out the rules which generate crunchgen'ed binaries into a separate 2010-11-13 03:11:27 +00:00
sbin Move most of the remaining USD/PSD/SMM papers into share/doc 2010-12-04 10:11:20 +00:00
secure Regenerate manual pages for OpenSSL 0.9.8q. 2010-12-03 23:07:45 +00:00
share Add a manpage for SYSINIT() and SYSUNINIT(). 2010-12-06 15:19:03 +00:00
sys opensolaris cyclic: fix deadlock and make a little bit closer to upstream 2010-12-07 12:25:26 +00:00
tools Work around gcc constant folding bugs. 2010-12-06 00:19:56 +00:00
usr.bin Don't write the terminating NUL past end of buffer. 2010-12-06 09:18:11 +00:00
usr.sbin Ignore any failures with the "local" distribution since it's not present 2010-12-06 20:55:14 +00:00
COPYRIGHT Happy New Year 2010! :-) 2009-12-31 10:00:37 +00:00
LOCKS Update LOCKS syntax. 2008-06-05 19:47:58 +00:00
MAINTAINERS Add a comment to MAINTAINERS indicating that sbin/routed is in fact 2010-04-10 12:29:09 +00:00
Makefile Import OpenSSL 0.9.8q. 2010-12-02 22:36:51 +00:00
Makefile.inc1 Do not lint code beyond necessity (with apologies to Wiliam of Ockham). 2010-11-18 16:32:52 +00:00
Makefile.mips Guard against TARGET_ABI being undefined (TARGET_ABI will go away soon) 2010-08-26 14:54:12 +00:00
ObsoleteFiles.inc Add MAKEDEV.8 2010-12-04 18:52:05 +00:00
README Import OpenSSL 0.9.8q. 2010-12-02 22:36:51 +00:00
UPDATING o Flesh out the generic IEEE 802.3 annex 31B full duplex flow control 2010-11-14 13:26:10 +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.

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.

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