Subject: Re: CVS commit: src
To: YAMAMOTO Takashi <>
From: Bill Studenmund <>
List: tech-kern
Date: 06/21/2004 21:51:56
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 22, 2004 at 10:46:28AM +0900, YAMAMOTO Takashi wrote:
> > > > and 2) it destroys our ability=20
> > > > to use v_vnlock. v_vnlock makes life much nicer for layered file sy=
> > > > as it lets us readily access one lock for a stack of vnodes.
> > >=20
> > > i think that it's better to remove v_vnlock because:
> > > - it's only useful in the limited cases.
> >=20
> > Let's see. Layered file systems and snapshots. They both make good use =
> > v_vnlock.
> layered filesystems can use it only when it uses 1:1 vnode mapping and
> the underlying filesystem uses lockmgr to implement vnode lock and
> the lock is exported.  it's very limited.

Every file system except unionfs is limited?

> > > - it involves complexity in layered filesystems
> > >   as they should deal with two cases. (exported and not exported)
> >=20
> > The exported case is the greatly prefered one. The only case where it=
> > isn't used will be unionfs. And if I could figure out a way to have=20
> > lockmgr() calls do the locking unionfs needs, I'd do that instead. :-)
> IMO, locking should be left to each filesystem implementations.
> it's a bad idea to force everybody to use the same one.
> (esp. when it's lockmgr. :-)

We used to do that. We then had each file system doing almost the exact=20
same thing. We did not like that situation. So we made everything use=20
lockmgr(), and life was better. The file system locking was much more=20
maintainable, and we gained a fair bit of functionality.

So while we may decide to do something other than lockmgr(), going to it=20
gained us a lot.

> > > - it violates VOP abstraction.
> > >   sharing a lock can be achieved using locking VOPs.
> >=20
> > It can, but the latter's slow,
> but it's clean.

Yes, and microkernels are "clean." Abstractions are good, but only when=20
they really gain you something.

I guess another part of my experience with this is that I made dmfs, the=20
data migration file system. In it, the ability to directly & quickly=20
change lock state was very useful.

> > and can blow the kernel stack. With just=20
> > one or two layers, it doesn't make that much difference. But with some =
> > the multi-layer ideas Heidemann had, we can get may more layers.
> locking VOPs are not likely the most stack-consuming VOPs.
> cheating only for them doesn't make much sense.

I don't look at it as a cheat. I look at it as a requirement that file=20
systems do real, hard-core locking. And given the state of things when I=20
started, that was a very good thing.

> > Also, I like Heidemann's idea of the collection of vnodes (the leaf one=
> > and the ones over it) acting as an aggregate object. One object, one lo=
> > v_vnlock points to it.
> >=20
> > I admit that v_vnlock is only a partial implementation of what Heideman=
> > describes. A more complete one, which worked well for unionfs, would be=
> > interesting.
> where can i read "what Heidemann describes"?

That would be his disseration.=20

Take care,


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)