Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Nov 2003 11:10:15 -0800
From:      Sam Leffler <sam@errno.com>
To:        Robert Watson <rwatson@freebsd.org>
Cc:        "M. Warner Losh" <imp@bsdimp.com>
Subject:   Re: PERFORCE change 41566 for review
Message-ID:  <200311061110.15196.sam@errno.com>
In-Reply-To: <Pine.NEB.3.96L.1031106133208.6087A-100000@fledge.watson.org>
References:  <Pine.NEB.3.96L.1031106133208.6087A-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 06 November 2003 10:33 am, Robert Watson wrote:
> 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 <sam@freebsd.org> 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.

You're right; wonder why I haven't hit that.  I started to go through all the 
drivers and do that but stopped when I realized the trip through the bridge 
and back into the start method was handled.  Guess it's because the drivers 
for all my NICs release on up call.

I'll sweep the drivers I can test.

	Sam



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311061110.15196.sam>