tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bnx_tick and the kernel lock



On Tue, Apr 17, 2012 at 04:23:07PM -0400, Thor Lancelot Simon wrote:
> On Tue, Apr 17, 2012 at 10:12:22PM +0200, Manuel Bouyer wrote:
> > On Tue, Apr 17, 2012 at 04:00:05PM -0400, Greg Troxel wrote:
> > > 
> > > I have some systems where the bnx driver seems to lose mbuf clusters
> > > under heavy load.
> > > 
> > > Looking at the code, I see bnx_tick called by a callout, and it does
> > > splnet but does not seem to take the KERNEL_LOCK.  It seems like the
> > > rule for the rest of the driver is to be at splnet and have the kernel
> > > lock, so this seems wrong.
> > > 
> > > Are callouts automatically invoked with the big lock?  It seems like
> > > they aren't (and shouldn't be) since they can be used in mpsafe code.
> > 
> > They are called with the big lock, for thoses which have been initialized
> > with CALLOUT_MPSAFE (which AFAIK bnx(4) does not).
> 
> "Those which have *not* been initialized with..." I think you mean?

Yes, I got things reversed, sorry. To make it clear:
a callout initialized with CALLOUT_MPSAFE will be called without the
  KERNEL_LOCK
a callout initialized without CALLOUT_MPSAFE will be called with the
  KERNEL_LOCK held.

bnx(4) doesn't initialize its callout with CALLOUT_MPSAFE, so the
callout callback is called with the KERNEL_LOCK held.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index