summaryrefslogtreecommitdiffstats
path: root/sys/sys/bufobj.h
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2005-06-10 23:50:41 +0000
committergreen <green@FreeBSD.org>2005-06-10 23:50:41 +0000
commitff904ffb643a4538cfbfba4658052e1b36e2bfe5 (patch)
tree4eeddcd51bbe2b1f2ab59415946715327f429a80 /sys/sys/bufobj.h
parent613f0c4df2e951f81d91d8550f1ce05c8aa55f2d (diff)
downloadFreeBSD-src-ff904ffb643a4538cfbfba4658052e1b36e2bfe5.zip
FreeBSD-src-ff904ffb643a4538cfbfba4658052e1b36e2bfe5.tar.gz
Fix a serious deadlock with the NFS client. Given a large enough
atomic write request, it can fill the buffer cache with the entirety of that write in order to handle retries. However, it never drops the vnode lock, or else it wouldn't be atomic, so it ends up waiting indefinitely for more buf memory that cannot be gotten as it has it all, and it waits in an uncancellable state. To fix this, hibufspace is exported and scaled to a reasonable fraction. This is used as the limit of how much of an atomic write request by the NFS client will be handled asynchronously. If the request is larger than this, it will be turned into a synchronous request which won't deadlock the system. It's possible this value is far off from what is required by some, so it shall be tunable as soon as mount_nfs(8) learns of the new field. The slowdown between an asynchronous and a synchronous write on NFS appears to be on the order of 2x-4x. General nod by: gad MFC after: 2 weeks More testing: wes PR: kern/79208
Diffstat (limited to 'sys/sys/bufobj.h')
-rw-r--r--sys/sys/bufobj.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/bufobj.h b/sys/sys/bufobj.h
index f938c80..cab7fb0 100644
--- a/sys/sys/bufobj.h
+++ b/sys/sys/bufobj.h
@@ -109,13 +109,13 @@ struct bufobj {
#define BO_LOCK(bo) \
do { \
- KASSERT (bo->bo_mtx != NULL, ("No lock in bufobj")); \
+ KASSERT((bo)->bo_mtx != NULL, ("No lock in bufobj")); \
mtx_lock((bo)->bo_mtx); \
} while (0)
#define BO_UNLOCK(bo) \
do { \
- KASSERT (bo->bo_mtx != NULL, ("No lock in bufobj")); \
+ KASSERT((bo)->bo_mtx != NULL, ("No lock in bufobj")); \
mtx_unlock((bo)->bo_mtx); \
} while (0)
OpenPOWER on IntegriCloud