diff options
author | dfr <dfr@FreeBSD.org> | 1996-11-06 10:53:16 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1996-11-06 10:53:16 +0000 |
commit | 4c8f7388e578751aab31ce0b8a982373a002aa7e (patch) | |
tree | b99fa8ba7a7ef13dafb400913ede1cef59f59743 /sys/nfs/nfsmount.h | |
parent | d7d2cfcbf0e341b9b9672dcde6e1be024ed506b9 (diff) | |
download | FreeBSD-src-4c8f7388e578751aab31ce0b8a982373a002aa7e.zip FreeBSD-src-4c8f7388e578751aab31ce0b8a982373a002aa7e.tar.gz |
Improve the queuing algorithms used by NFS' asynchronous i/o. The
existing mechanism uses a global queue for some buffers and the
vp->b_dirtyblkhd queue for others. This turns sequential writes into
randomly ordered writes to the server, affecting both read and write
performance. The existing mechanism also copes badly with hung
servers, tending to block accesses to other servers when all the iods
are waiting for a hung server.
The new mechanism uses a queue for each mount point. All asynchronous
i/o goes through this queue which preserves the ordering of requests.
A simple mechanism ensures that the iods are shared out fairly between
active mount points. This removes the sysctl variable vfs.nfs.dwrite
since the new queueing mechanism removes the old delayed write code
completely.
This should go into the 2.2 branch.
Diffstat (limited to 'sys/nfs/nfsmount.h')
-rw-r--r-- | sys/nfs/nfsmount.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/nfs/nfsmount.h b/sys/nfs/nfsmount.h index 1bd71c5..a1c3b38 100644 --- a/sys/nfs/nfsmount.h +++ b/sys/nfs/nfsmount.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsmount.h 8.1 (Berkeley) 6/10/93 - * $Id: nfsmount.h,v 1.6 1995/11/21 12:54:40 bde Exp $ + * $Id: nfsmount.h,v 1.7 1995/12/17 21:12:36 phk Exp $ */ #ifndef _NFS_NFSMOUNT_H_ @@ -82,6 +82,10 @@ struct nfsmount { int nm_numuids; /* Number of nfsuid mappings */ TAILQ_HEAD(, nfsuid) nm_uidlruhead; /* Lists of nfsuid mappings */ LIST_HEAD(, nfsuid) nm_uidhashtbl[NFS_MUIDHASHSIZ]; + TAILQ_HEAD(, buf) nm_bufq; /* async io buffer queue */ + short nm_bufqlen; /* number of buffers in queue */ + short nm_bufqwant; /* process wants to add to the queue */ + int nm_bufqiods; /* number of iods processing queue */ }; #if defined(KERNEL) || defined(_KERNEL) @@ -89,6 +93,23 @@ struct nfsmount { * Convert mount ptr to nfsmount ptr. */ #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data)) + +#ifdef NFS_DEBUG + +extern int nfs_debug; +#define NFS_DEBUG_ASYNCIO 1 + +#define NFS_DPF(cat, args) \ + do { \ + if (nfs_debug & NFS_DEBUG_##cat) printf args; \ + } while (0) + +#else + +#define NFS_DPF(cat, args) + +#endif + #endif /* KERNEL */ #endif |