From owner-freebsd-current@FreeBSD.ORG Fri Jun 1 11:17:32 2007 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51E7616A421 for ; Fri, 1 Jun 2007 11:17:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 29F2B13C4AD for ; Fri, 1 Jun 2007 11:17:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 9931B46C48 for ; Fri, 1 Jun 2007 07:17:31 -0400 (EDT) Date: Fri, 1 Jun 2007 12:17:31 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: current@FreeBSD.org In-Reply-To: <20070601105521.D77697@fledge.watson.org> Message-ID: <20070601121347.M77697@fledge.watson.org> References: <20070601105521.D77697@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: NET_NEEDS_GIANT removal X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2007 11:17:32 -0000 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