diff options
author | jeff <jeff@FreeBSD.org> | 2004-11-18 08:44:09 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2004-11-18 08:44:09 +0000 |
commit | 9caab2e84389f65b9ff83b89b6b9842c315c524b (patch) | |
tree | a2660fd5e71e5a909689ab2e6917d6e1d47d5b55 /sys/ufs | |
parent | dbceb16b545647d0b326249600ce96d92cd056d5 (diff) | |
download | FreeBSD-src-9caab2e84389f65b9ff83b89b6b9842c315c524b.zip FreeBSD-src-9caab2e84389f65b9ff83b89b6b9842c315c524b.tar.gz |
- Eliminate the acquisition and release of the bqlock in bremfree() by
setting the B_REMFREE flag in the buf. This is done to prevent lock order
reversals with code that must call bremfree() with a local lock held.
This also reduces overhead by removing two lock operations per buf for
fsync() and similar.
- Check for the B_REMFREE flag in brelse() and bqrelse() after the bqlock
has been acquired so that we may remove ourself from the free-list.
- Provide a bremfreef() function to immediately remove a buf from a
free-list for use only by NFS. This is done because the nfsclient code
overloads the b_freelist queue for its own async. io queue.
- Simplify the numfreebuffers accounting by removing a switch statement
that executed the same code in every possible case.
- getnewbuf() can encounter locked bufs on free-lists once Giant is removed.
Remove a panic associated with this condition and delay asserts that
inspect the buf until after it is locked.
Reviewed by: phk
Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index e903b6d..3716bb0 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -208,14 +208,15 @@ loop: continue; if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) continue; + VI_UNLOCK(vp); if (!wait && LIST_FIRST(&bp->b_dep) != NULL && (bp->b_flags & B_DEFERRED) == 0 && buf_countdeps(bp, 0)) { bp->b_flags |= B_DEFERRED; BUF_UNLOCK(bp); + VI_LOCK(vp); continue; } - VI_UNLOCK(vp); if ((bp->b_flags & B_DELWRI) == 0) panic("ffs_fsync: not dirty"); /* |