Subject: Re: split LFS vnode locks
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Konrad Schroder <perseant@hhhh.org>
List: tech-kern
Date: 12/16/2002 11:43:11
On Sun, 15 Dec 2002, YAMAMOTO Takashi wrote:

> currently, since lfs_markv have to acquire vnode locks,
> lfs_reserve have to release vnode locks before wait for lfs_avail.
> however, releasing locks in lfs_reserve isn't safe because
> we can't keep the vnodes/inodees from modifying without holding the locks.
>
> i'd like to separate metadata (ie. block pointers) lock from vnode lock
> so that lfs_reserve no longer need to release vnode locks as attached patch.
> is it ok?

Moving lfs_reserve out of lfs_bwrite_ext is a good idea, but I have a
suggestion regarding the proposed meta locks.  Do you ever use the new
meta locks in a context that does not already require the segment lock?

Block pointers only change during write and file allocation, both of which
already require the segment lock; this would obviate the new locks, and
since the segment writer is already single-threaded, it might not be
necessary for the segment writer to lock the vnodes at all---references
would be enough.  If that worked, it would simplify the locking mess quite
a bit....
						Konrad Schroder
						perseant@hhhh.org