freebsd with flexible iflib nic queues
Go to file
Konstantin Belousov 94f4ac214c An inode block must not be blockingly read while cg block is owned.
The order is inode buffer lock -> snaplk -> cg buffer lock, reversing
the order causes deadlocks.

Inode block must not be written while cg block buffer is owned. The
FFS copy on write needs to allocate a block to copy the content of the
inode block, and the cylinder group selected for the allocation might
be the same as the owned cg block.  The reserved block detection code
in the ffs_copyonwrite() and ffs_bp_snapblk() is unable to detect the
situation, because the locked cg buffer is not exposed to it.

In order to maintain the dependency between initialized inode block
and the cg_initediblk pointer, look up the inode buffer in
non-blocking mode. If succeeded, brelse cg block, initialize the inode
block and write it.  After the write is finished, reread cg block and
update the cg_initediblk.

If inode block is already locked by another thread, let the another
thread initialize it.  If another thread raced with us after we
started writing inode block, the situation is detected by an update of
cg_initediblk.  Note that double-initialization of the inode block is
harmless, the block cannot be used until cg_initediblk is incremented.

Sponsored by:	The FreeBSD Foundation
In collaboration with:	pho
Reviewed by:	mckusick
MFC after:	1 month
X-MFC-note:	after r246877
2013-02-27 07:31:23 +00:00
bin Enhance test(1) by adding provision to compare any combination of the 2013-02-25 19:05:40 +00:00
cddl MFV v242732: 2013-02-25 12:33:31 +00:00
contrib Clear the memory allocated to build the unwind tables. This fixes C++ 2013-02-27 06:53:15 +00:00
crypto Import change 6d783560e4aad1e680097d11e89755647a5aba87 from upstream 2013-02-19 17:38:18 +00:00
etc If rtadvd_interfaces is set to "none", start rtadvd without listing 2013-02-25 17:07:42 +00:00
games Remove political propaganda 2013-02-05 14:39:37 +00:00
gnu kgdb enhancements! 2013-02-19 02:09:18 +00:00
include FreeBSD uses #if __BSD_VISIBLE to hide non-standard functions, fix this. 2013-02-14 19:26:58 +00:00
kerberos5 Add -lheimntlm to LDADD directly. 2013-02-11 09:45:24 +00:00
lib no one bothered to write the iconv.9 man page... If it appears we 2013-02-26 19:46:02 +00:00
libexec Since clang 3.2 now has an option to suppress warnings about implicitly 2013-02-16 20:17:31 +00:00
release the NO_PAM option has been finally removed in favor of WITHOUT_PAM. 2013-02-18 02:08:41 +00:00
rescue Disconnect non-MPSAFE SMBFS from the build in preparation for dropping 2012-10-18 12:04:56 +00:00
sbin Fix typo in EFI GPT GUID. 2013-02-27 03:43:16 +00:00
secure Merge OpenSSL 1.0.1e. 2013-02-13 23:07:20 +00:00
share cxgbe(4): Consider all the API versions of the interfaces exported by 2013-02-26 20:35:54 +00:00
sys An inode block must not be blockingly read while cg block is owned. 2013-02-27 07:31:23 +00:00
tools Enhance test(1) by adding provision to compare any combination of the 2013-02-25 19:05:40 +00:00
usr.bin Revert r247300 for now. I'll post a new changeset for review. 2013-02-26 19:46:59 +00:00
usr.sbin Ignore the BARRIER flag in the virtio block header. 2013-02-26 20:02:17 +00:00
COPYRIGHT Happy New Year 2013! 2012-12-31 11:22:55 +00:00
LOCKS Test commit to make sure commit mail works after moving the server. 2012-12-29 16:03:23 +00:00
MAINTAINERS Fix typo ('a' and 'o' are not the same letter apparently) 2012-10-22 14:48:14 +00:00
Makefile Import OpenSSL 1.0.1e. 2013-02-13 22:15:56 +00:00
Makefile.inc1 In all situations where we need to bootstrap yacc, we also need to 2013-02-25 22:25:56 +00:00
ObsoleteFiles.inc Add more obsolete files. 2013-02-09 13:28:49 +00:00
README Import OpenSSL 1.0.1e. 2013-02-13 22:15:56 +00:00
UPDATING - Fix typo 2013-01-30 10:23:38 +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