Re: LOCKLEAF is not used in Darwin8?
Re: LOCKLEAF is not used in Darwin8?
- Subject: Re: LOCKLEAF is not used in Darwin8?
- From: Terry Lambert <email@hidden>
- Date: Thu, 2 Mar 2006 18:05:09 -0800
On Mar 1, 2006, at 8:57 PM, Lex Dejavu wrote:
I've read throught bsd/vfs and find it's not checked by any
function, although it's set somewhere.
Regards
It's a hint to the FS to do something (or not) based on the FS's
locking model.
Locks are now generally asserted on the vp at the VFS layer, rather
than below the VFS layer on the inode.
We don't internally use it because for the FS's where we would have
used it, we support thread reentrancy. For third party FS's that
don't support thread reentrancy (i.e. neither VFS_TBLTHREADSAFE nor
VFS_TBLFSNODELOCK is set), the locking is per fs, per entry into the
VFS, unless that FS advertises that is supports node locking as it's
model, which means the FS will take care of locking, and the VFS
doesn't need to guard reentrancy on its behalf).
If you support locking via inode/cnode/whatevernode locking, you are
expected to honor LOCKLEAF, e.g.:
----------------------------------------- -----------------
SUPPORTS LOCKLEAF
VFS_TBLFSNODELOCK VFS_TBLTHREADSAFE FS must honor
----------------- ----------------- -----------------
NO NO NO
YES NO YES
NO YES NO
YES YES MAYBE
----------------- ----------------- -----------------
The "MAYBE" is based on whether you require both vnode lock an inode
lock held spearately or not. If you do, then you must ensure the lock
ordering is the same each time you take a lock, and that everything
works the same. I do not recommend this model at all.
Primarily, this is to allow people to more easily port legacy code,
but in general, your best bet is to support VFS_TBLTHREADSAFE and
thread reentrancy, and let the VFS layer take care of managing the
locking on a per vp reentrancy basis, instead of trying to do this
yourself, or shave off some additional concurrency by going pure
VFS_TBLFSNODELOCK, which is very hard unless you have a full event/
action graph model for your FS implementation.
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden