diff options
author | dfr <dfr@FreeBSD.org> | 1997-05-10 16:59:36 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1997-05-10 16:59:36 +0000 |
commit | 824696dc98c3a0d29af46d3b3ef2a83c1195aea9 (patch) | |
tree | 72b0708fa5aa935ece6b4d428dbb0e9c338e108f /sys/nfsserver | |
parent | ff5630dff67f4c3a38f2d5f2cc72d3bc7d9c2f4e (diff) | |
download | FreeBSD-src-824696dc98c3a0d29af46d3b3ef2a83c1195aea9.zip FreeBSD-src-824696dc98c3a0d29af46d3b3ef2a83c1195aea9.tar.gz |
Implement a separate control for write gathering on NFSv3. This is turned
off for NFSv3 by default since write gathering seems to reduce performance
for NFSv3 by up to 60%.
Add sysctl knobs to control both variables.
Diffstat (limited to 'sys/nfsserver')
-rw-r--r-- | sys/nfsserver/nfs_serv.c | 6 | ||||
-rw-r--r-- | sys/nfsserver/nfs_syscalls.c | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 7946328..75842dc 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_serv.c,v 1.40 1997/03/29 12:40:18 bde Exp $ + * $Id: nfs_serv.c,v 1.41 1997/05/10 16:12:03 dfr Exp $ */ /* @@ -96,6 +96,7 @@ extern enum vtype nv3tov_type[8]; extern struct nfsstats nfsstats; int nfsrvw_procrastinate = NFS_GATHERDELAY * 1000; +int nfsrvw_procrastinate_v3 = 0; int nfs_async; SYSCTL_INT(_vfs_nfs, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, ""); @@ -929,7 +930,8 @@ nfsrv_writegather(ndp, slp, procp, mrq) nfsd->nd_mreq = NULL; nfsd->nd_stable = NFSV3WRITE_FILESYNC; cur_usec = (u_quad_t)time.tv_sec * 1000000 + (u_quad_t)time.tv_usec; - nfsd->nd_time = cur_usec + nfsrvw_procrastinate; + nfsd->nd_time = cur_usec + + (v3 ? nfsrvw_procrastinate_v3 : nfsrvw_procrastinate); /* * Now, get the write header.. diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c index ea35c01..83cfa95 100644 --- a/sys/nfsserver/nfs_syscalls.c +++ b/sys/nfsserver/nfs_syscalls.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95 - * $Id: nfs_syscalls.c,v 1.21 1997/04/27 20:01:23 wollman Exp $ + * $Id: nfs_syscalls.c,v 1.22 1997/04/30 09:51:37 dfr Exp $ */ #include <sys/param.h> @@ -86,6 +86,7 @@ extern int nqsrv_writeslack; extern int nfsrtton; extern struct nfsstats nfsstats; extern int nfsrvw_procrastinate; +extern int nfsrvw_procrastinate_v3; struct nfssvc_sock *nfs_udpsock, *nfs_cltpsock; static int nuidhash_max = NFS_MAXUIDHASH; @@ -111,6 +112,8 @@ static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); static int nfs_privport = 0; SYSCTL_INT(_vfs_nfs, NFS_NFSPRIVPORT, nfs_privport, CTLFLAG_RW, &nfs_privport, 0, ""); +SYSCTL_INT(_vfs_nfs, OID_AUTO, gatherdelay, CTLFLAG_RW, &nfsrvw_procrastinate, 0, ""); +SYSCTL_INT(_vfs_nfs, OID_AUTO, gatherdelay_v3, CTLFLAG_RW, &nfsrvw_procrastinate_v3, 0, ""); /* * NFS server system calls @@ -456,6 +459,7 @@ nfssvc_nfsd(nsd, argp, p) struct nfsrv_descript *nd = NULL; struct mbuf *mreq; int error = 0, cacherep, s, sotype, writes_todo; + int procrastinate; u_quad_t cur_usec; #ifndef nolint @@ -626,8 +630,12 @@ nfssvc_nfsd(nsd, argp, p) do { switch (cacherep) { case RC_DOIT: + if (nd && (nd->nd_flag & ND_NFSV3)) + procrastinate = nfsrvw_procrastinate_v3; + else + procrastinate = nfsrvw_procrastinate; if (writes_todo || (nd->nd_procnum == NFSPROC_WRITE && - nfsrvw_procrastinate > 0 && !notstarted)) + procrastinate > 0 && !notstarted)) error = nfsrv_writegather(&nd, slp, nfsd->nfsd_procp, &mreq); else |