VNode sequencing and locking - part 2/4.
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 11 Aug 2006 01:55:02 +0000 (01:55 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 11 Aug 2006 01:55:02 +0000 (01:55 +0000)
commite33324756e54f83002a73bbeb4e3279d90fe9f34
treec7562d1769aafe02f11e85bd860bac544d2949b8
parent44b1cf3dde5a3bcad373ed2dbc821befd0035531
VNode sequencing and locking - part 2/4.

Control access to v_usecount and v_holdcnt with the vnode's lock's spinlock.
Use the spinlock to interlock the VRECLAIMED and VINACTIVE flags during
1->0 and 0->1 transitions.  N->N+1 transitions do not need to obtain the
spinlock and simply use a locked bus cycle increment.  Vnode operations
are still not MP safe but this gets further along that road.

The lockmgr can no longer fail when obtaining an exclusive lock, remove
the error code return from vx_lock() and vx_get().  Add special lockmgr
support routines to atomically acquire and release an exclusive lock
when the caller is already holding the spinlock.

The removal of vnodes from the vnode free list is now defered.  Removal
only occurs when allocvnode() encounters a vnode on the list which should
not be on it.  This improves critical code paths for vget(), vput() and
vrele() by removing unnecessary manipulation of the freelist.

Fix a lockmgr bug where wakeup() was being called with a spinlock held.
Instead, defer the wakeup until after the spinlock is released.
sys/emulation/linux/i386/linprocfs/linprocfs_subr.c
sys/kern/kern_exit.c
sys/kern/kern_lock.c
sys/kern/vfs_lock.c
sys/kern/vfs_mount.c
sys/kern/vfs_subr.c
sys/kern/vfs_syscalls.c
sys/sys/lock.h
sys/sys/vnode.h
sys/vfs/procfs/procfs_subr.c
sys/vfs/union/union_vnops.c