freebsd kernel with SKQ
Go to file
Coleman Kane 21a6592999 Convert ndis_spinlock to ndis_mtx and start using the sleepable
mtx interface for NDIS_LOCK/UNLOCK. This should result in less
CPU utilization on behalf of the ndis driver. Additionally, this
commit also fixes a potential LOR in the ndis_tick code, by
not locking inside the ndis_tick function, but instead delegating
that work to the helpers called through IoQueueWorkItem. The
way that this is currently set up for NDIS prevents us from
simply implementing a callout_init_mtx mechanism.

However, the helper functions that handle the various timeout
cases implement fine-grained locking using the spinlocks provided
by the NDIS-compat layer, and using the mtx that is added with
this commit. This leaves the following ndis_softc members operated
on in ndis_tick in an unlocked context:

  * ndis_hang_timer - Only modified outside of ndis_tick once, before
                      the first callout_reset to schedule ndis_tick
  * ifp->if_oerrors - Only incremented in two places, which should be
                      an atomic op
  * ndis_tx_timer   - Assigned to 5 (when guaranteed to be 0) or 0
                      (in txeof), to indicate to ndis_tick what to
                      do. This is the only member of which I was
                      suspicious for needing the NDIS_LOCK here. My
                      testing (and another's) have been fine so far.
  * ndis_stat_callout - Only uses a simple set of callout routines,
                        callout_reset only called by ndis_tick after
                        the initial reset, and then callout_drain is
                        used exactly once in shutdown code.

The benefit is that ndis_tick doesn't acquire NDIS_LOCK unless one of
the timeout conditions is flagged, and it still obeys the locking
order semantics that are dictated by the NDIS layer at the moment. I
have been investigating a more thorough s/spinlock/mtx/ of the NDIS
layer, but the simplest naive approach (replace KeAcquireSpinLock
with an mtx implementation) has anti-succeeded for me so far. This
is a good first step though.

Tested by:	onemda@gmail.com
Reviewed by:	current@, jhb, thompsa
Proposed by:	jhb
2008-06-11 13:40:15 +00:00
bin use 'const' for the parameters of the two static functions unalias() and hashalias() 2008-06-07 16:28:20 +00:00
cddl Don't need to include vmem.h anymore. 2008-05-23 22:44:46 +00:00
contrib Optimize the CVS bug #17168 fix by relaxing the conditions for update 2008-06-06 16:16:44 +00:00
crypto Fix conflicts after heimdal-1.1 import and add build infrastructure. Import 2008-05-07 13:53:12 +00:00
etc Tweak rc.firewall to allow incoming limited broadcast traffic, 2008-06-06 07:17:04 +00:00
games Fixed the output grammar to properly speak non-terminal dits. 2008-06-08 19:35:47 +00:00
gnu Install GNU cpio as 'gcpio', symlink to 'cpio' unless WITH_BSDCPIO is 2008-05-26 17:21:12 +00:00
include Make pthread_cleanup_push() and pthread_cleanup_pop() as a pair of macros, 2008-06-09 01:14:10 +00:00
kerberos5 Add the hx509 error table. 2008-05-15 08:53:31 +00:00
lib In the error path through base_alloc(), release base_mtx [1]. 2008-06-10 15:46:18 +00:00
libexec Use sysctl to fetch stats from the kernel instead of reading variables 2008-06-10 18:47:43 +00:00
release Obsolete gpt(8) by replacing it with geom(8). Add the glabel and 2008-06-05 15:32:05 +00:00
rescue Remove netatm from HEAD as it is not MPSAFE and relies on the now removed 2008-05-25 22:11:40 +00:00
sbin Remove gpt(8). It's replaced by gpart(8). 2008-06-09 21:30:40 +00:00
secure Fix conflicts after heimdal-1.1 import and add build infrastructure. Import 2008-05-07 13:53:12 +00:00
share Add Belkin F5U257 to the mix. 2008-06-10 19:33:31 +00:00
sys Convert ndis_spinlock to ndis_mtx and start using the sleepable 2008-06-11 13:40:15 +00:00
tools Update mctest and its associated script to have a base port to listen 2008-06-03 20:54:46 +00:00
usr.bin Make one-bit fields unsigned instead of signed. This has no effect, 2008-06-09 14:41:28 +00:00
usr.sbin Remove sicontrol(8)'s "ttystat". 2008-06-09 08:43:27 +00:00
COPYRIGHT Happy new year 2008! 2007-12-31 22:09:19 +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 Backout the change to remove sun4v. 2008-05-25 22:13:17 +00:00
Makefile.inc1 Add the DTrace build tools to the list of tools and pass NO_CTF to all 2008-05-23 04:22:14 +00:00
ObsoleteFiles.inc Removal of gpt(8) and manpage. 2008-06-09 21:36:46 +00:00
README Simply running ``make world'' will bomb unless you dig up the 2006-06-07 03:33:48 +00:00
UPDATING Note removal of gpt(8). 2008-06-09 21:33:57 +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