Re: NET_NEEDS_GIANT removal

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Fri, 1 Jun 2007 12:17:31 +0100 (BST)
On Fri, 1 Jun 2007, Robert Watson wrote:

> This is the compatibility code that allows non-MPSAFE network protocols to 
> operate--when they are compiled into the kernel, Giant is forced over the 
> entire network stack.  This allows them to run moderately safely, but 
> eliminates use of more than one processor at a time in any part of the 
> network stack, as well as increasing contention on Giant for any other 
> non-MPSAFE components, requiring Giant be acquired in possible shared 
> ithreads, etc. The components currently requiring Giant are:

For those wondering what the results of this look like, I've start putting 
together an initial patch to remove the following compatibility shim parts 
associated with debug.mpsafenet:

- NET_NEEDS_GIANT()
- NET_LOCK_GIANT(), NET_UNLOCK_GIANT(), NET_ASSERT_GIANT()
- NET_CALLOUT_MPSAFE
- debug_mpsafenet

The draft is here:

   http://www.watson.org/~robert/freebsd/netperf/20070601-de_mpsafenet.diff

It does not yet compile (and it not tested), as parts requiring 
NET_NEEDS_GIANT() haven't been removed/disabled yet, but does begin to give a 
sense of how removing these shims cleans up many complex code paths.  Among 
other things, it removes 11 goto's in the socket exception handling code.

Robert N M Watson
Computer Laboratory
University of Cambridge
Received on Fri Jun 01 2007 - 09:17:32 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:11 UTC