diff options
author | Brian Feldman <green@FreeBSD.org> | 2005-06-10 23:50:41 +0000 |
---|---|---|
committer | Brian Feldman <green@FreeBSD.org> | 2005-06-10 23:50:41 +0000 |
commit | cc3149b1eadc706863a469e169e3f466294e9ec3 (patch) | |
tree | 4eeddcd51bbe2b1f2ab59415946715327f429a80 /sys/sys/buf.h | |
parent | c7c0d2e3e48cf5c3c448344050a8dd5eb83ddd3b (diff) | |
download | src-cc3149b1eadc706863a469e169e3f466294e9ec3.tar.gz src-cc3149b1eadc706863a469e169e3f466294e9ec3.zip |
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
Notes
Notes:
svn path=/head/; revision=147280
Diffstat (limited to 'sys/sys/buf.h')
-rw-r--r-- | sys/sys/buf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 8f68ff29acde..9f8fc2f4c91c 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -465,6 +465,7 @@ extern int nbuf; /* The number of buffer headers */ extern int maxswzone; /* Max KVA for swap structures */ extern int maxbcache; /* Max KVA for buffer cache */ extern int runningbufspace; +extern int hibufspace; extern int buf_maxio; /* nominal maximum I/O for buffer */ extern struct buf *buf; /* The buffer headers. */ extern char *buffers; /* The buffer contents. */ |