tech-kern archive

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

locking from VOP_INACTIVE to VOP_RECLAIM



Currently:

- For VOP_INACTIVE, vnode lock is held on entry and released on exit.
- For VOP_RECLAIM, vnode lock is not held on entry.

I would like to change this so that:

- For VOP_INACTIVE, vnode lock is held on entry and exit.
- For VOP_RECLAIM, vnode lock is held on entry.

VOP_RECLAIM then *destroys* the lock, so we don't have to say whether
it is held or released on exit.  This requires a one-line change to
vfs_vnode.c, and then mechanically moving VOP_UNLOCK from *_inactive
to *_reclaim throughout the file systems.

I did a quick survey of every VOP_INACTIVE in src/sys.  With one
exception, every one either (a) does VOP_UNLOCK just before return, or
(b) defers to another VOP_INACTIVE method.  The one exception is
nfs_inactive, which also queues something up on a workqueue, but I
can't imagine that it matters whether the vnode lock is held.

Benefit: Functions that VOP_RECLAIM calls would be able to assert,
rather than vaguely assume, exclusive ownership of the vnode lock.
Currently various code paths, e.g. ffs_update, require exclusive
access to the vnode in question, which can't be asserted right now
because of the VOP_RECLAIM exception.

Thoughts?  Objections?


Home | Main Index | Thread Index | Old Index