Subject: Re: Buffers and vnodes
To: Bill Stouder-Studenmund <wrstuden@netbsd.org>
From: Andrew Doran <ad@netbsd.org>
List: tech-kern
Date: 06/27/2007 22:09:48
On Mon, Jun 25, 2007 at 11:32:00AM -0700, Bill Stouder-Studenmund wrote:
> On Mon, Jun 25, 2007 at 11:01:23AM -0700, Bill Stouder-Studenmund wrote:
> > On Mon, Jun 25, 2007 at 02:13:51PM +0100, Andrew Doran wrote:
> > > Hi,
> > > 
> > > One of the remaining problem areas in vfs wrt locking is the buffer cache.
> > > With vfs & ffs run without the kernel lock, eventually the system will
> > > deadlock with one or more threads stuck in in biowait. So I guess that
> > > somewhere the necessary locks are not being taken, and it's losing state.
> > > 
> > > I've been looking into simplifying the locking, as it's unclear what's
> > > covered by the long term lock (B_BUSY) and the short term lock
> > > (b_interlock). One thing I'd like to do is replace b_interlock with a
> > > pointer to the interlock for the vnode that the buffer is currently
> > > associated with.
> 
> Thinking about this, what is the locking protocol for unassociating a 
> buffer with a vnode? Also, do we ever change association from one vnode to 
> another? If so, what protocol should we follow then?

That's the bit I'm still working on. :-)

Andrew