tech-kern archive

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

Re: tstile syndrome



On Fri, Sep 11, 2009 at 03:14:09PM -0700, Jason Thorpe wrote:
>> Such as? Please give clear examples. Moving the locks to below the VFS
>> layer does not change any of the ordering constraints or any of the
>> hard problems (vnode recycle, rename, etc.) but only forces cutting
>> and pasting 30 copies of what was previously FS-independent code into
>> every FS.
>
> Not true at all.  In Mac OS X, there is no exposed vnode-level locking  
> at the VFS layer or in the VFS<->file system interface.  Everything is  
> handled at the lower layers.

How does this simplify the hard problems (vnode recycle, rename,
etc.)?

Please give clear examples.

Also, how does it work with layers? And how do you make atomic
create/mkdir work correctly?

> The reason that you don't end up copy- 
> pasting 30 copies, etc. is because it gives you a chance to dump the  
> completely irrational locking protocol that currently exists.

Such as? Please give clear examples.

For e.g. mkdir you need to lock the parent directory vnode before
doing a lookup and unlock it only after doing the create call, or
whatever other vnode operation you use to actually create the
directory. Open with O_EXCL has the same requirement, except that
because it's one of several cases with open (some of which are not
trivial and may involve continuing in namei) it's much more
complicated.

Without exposed locks the only correct way to do this is to cut and
paste the lookup-and-create logic for both these operations into each
of 30 filesystems. Is this what you do in MacOS? Or is MacOS
incorrect? There are of course infinitely many incorrect approaches.

There are only two things seriously wrong with the vnode locking we
currently have; one is that many VOP calls are not symmetric (that is,
locks are in a different state upon return) and the other is that
namei is an octopus. The first of these problems is readily fixed,
although because the mess has been cut and pasted 30 times it's not so
trivial to get done safely. The second I'm working on.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index