From owner-p4-projects@FreeBSD.ORG Thu Nov 6 10:35:20 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C4D1A16A4D1; Thu, 6 Nov 2003 10:35:19 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9644716A4D0; Thu, 6 Nov 2003 10:35:19 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1ACF243FE1; Thu, 6 Nov 2003 10:35:16 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9p2/8.12.9) with ESMTP id hA6IXPMg006250; Thu, 6 Nov 2003 13:33:25 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)hA6IXP0I006247; Thu, 6 Nov 2003 13:33:25 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Thu, 6 Nov 2003 13:33:25 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Sam Leffler In-Reply-To: <200311061032.37691.sam@errno.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: sam@freebsd.org cc: perforce@freebsd.org cc: "M. Warner Losh" Subject: Re: PERFORCE change 41566 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2003 18:35:20 -0000 On Thu, 6 Nov 2003, Sam Leffler wrote: > On Thursday 06 November 2003 12:26 am, M. Warner Losh wrote: > > In message: <200311060513.hA65Da5J091575@repoman.freebsd.org> > > > > Sam Leffler writes: > > : diff reduction against head > > : - SIS_UNLOCK(sc); > > : (*ifp->if_input)(ifp, m); > > : - SIS_LOCK(sc); > > > > does this mean that we can call if_input with our locks held? > > sis's lock is setup MTX_RECURSE in which case re-entry is handled. You > only need to release the lock when you may be re-entered and it's not > setup as recursive. I think recursive locks are bad but so long as the > driver is setup to use them I'm not releasing them when calling up. However, this could potentially lead to lock order reversal between the network stack locks and the interface lock. We know the stack will grab lots of locks in the input routine with direct dispatch. We also know the stack will invoke the interface output routine while holding stack locks... I think it makes the most sense to place interface locks after network stack locks in the lock order, which would preclude holding the interface lock and then entering the stack. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories