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.
This commit is contained in:
Doug Rabson 1997-05-10 16:59:36 +00:00
parent 5ae0f71815
commit 0160dedc65
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25664
5 changed files with 38 additions and 10 deletions

View File

@ -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..

View File

@ -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

View File

@ -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

View File

@ -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..

View File

@ -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