Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Oct 1996 11:26:07 +0100 (BST)
From:      Doug Rabson <dfr@render.com>
To:        Charles Henrich <henrich@crh.cl.msu.edu>
Cc:        Peter Wemm <peter@spinner.dialix.com>, freebsd-lite2@FreeBSD.org
Subject:   Re: NFS from Solaris Server
Message-ID:  <Pine.BSF.3.95.961009111734.10204b-100000@minnow.render.com>
In-Reply-To: <199610081946.PAA01816@crh.cl.msu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 8 Oct 1996, Charles Henrich wrote:

> > The reason I pointed you to the lite2 list, is that Doug Rabson(sp?) has
> > been slaving away at incorporating the 4.4Lite2 NFS into the rest of the
> > FreeBSD+Lite2 kernel code.
> >
> > I'm wondering if Doug would be interested in having you try the results
> > so far?
> 
> I'd be happy to give it a whirl..

I just tried to reproduce the problem between a FreeBSD-lite2 machine and
an SGI Indy running IRIX 5.3 without success.  I get a consistent
~700k/sec write and 1000k/sec read whatever I do to nfssvc_iod or
nfs_asyncio.  I don't think this is due to new code in lite2 since the NFS
in lite2 is very similar to the NFS in current.  They were both derived
from Rick Macklems NFSv3 work. 

Since NFS performance is a black art and the choice of server is a big
factor in read / write speeds, you might like to experiment with this
patch.  It modifies nfssvc_iod so that you can control the number of
delayed write buffers that the iod processes before it goes back to sleep.
Using this it should be possible to stop it from locking out the other
iods by preventing a race with the writing process.  Try different values
for nfs_maxdelwri to see what works best.

The patch is from a lite2 cvs tree but should apply to current sources.
If you want to try out lite2 itself, you can get the cvs tree with cvsup
and this supfile:

src-sys release=lite2 host=sup.FreeBSD.org hostbase=/home base=/home prefix=/b/dfr/lite2 delete old use-rel-suffix



Index: nfs_syscalls.c
===================================================================
RCS file: /host/minnow/b/dfr/lite2/src/sys/nfs/nfs_syscalls.c,v
retrieving revision 1.14.2000.1
diff -u -r1.14.2000.1 nfs_syscalls.c
--- nfs_syscalls.c	1996/09/23 13:25:16	1.14.2000.1
+++ nfs_syscalls.c	1996/10/09 09:56:34
@@ -88,6 +88,7 @@
 extern int nfsrvw_procrastinate;
 struct nfssvc_sock *nfs_udpsock, *nfs_cltpsock;
 static int nuidhash_max = NFS_MAXUIDHASH;
+int nfs_maxdelwri = 1;
 
 static void	nfsrv_zapsock __P((struct nfssvc_sock *slp));
 static int	nfssvc_iod __P((struct proc *));
@@ -762,19 +763,28 @@
 		     * avoid any risk of the vnode getting vclean()'d while
 		     * we are doing the write rpc.
 		     */
+		    int ndelwri = 0;
 		    vp = bp->b_vp;
-		    s = splbio();
-		    for (nbp = vp->v_dirtyblkhd.lh_first; nbp;
-			nbp = nbp->b_vnbufs.le_next) {
-			if ((nbp->b_flags &
-			    (B_BUSY|B_DELWRI|B_NEEDCOMMIT|B_NOCACHE))!=B_DELWRI)
-			    continue;
-			bremfree(nbp);
-			vfs_busy_pages(nbp, 1);
-			nbp->b_flags |= (B_BUSY|B_ASYNC);
-			break;
-		    }
-		    splx(s);
+		    /*
+		     * Limit the number of B_DELWRI buffers we handle to
+		     * avoid locking out the other iods.
+		     */
+		    if (ndelwri == nfs_maxdelwri) {
+			s = splbio();
+			for (nbp = vp->v_dirtyblkhd.lh_first; nbp;
+			     nbp = nbp->b_vnbufs.le_next) {
+			    if ((nbp->b_flags &
+				 (B_BUSY|B_DELWRI|B_NEEDCOMMIT|B_NOCACHE))!=B_DELWRI)
+				continue;
+			    bremfree(nbp);
+			    vfs_busy_pages(nbp, 1);
+			    nbp->b_flags |= (B_BUSY|B_ASYNC);
+			    ndelwri++;
+			    break;
+			}
+			splx(s);
+		    } else
+			nbp = NULL;
 		    /*
 		     * For the delayed write, do the first part of nfs_bwrite()
 		     * up to, but not including nfs_strategy().



--
Doug Rabson, Microsoft RenderMorphics Ltd.	Mail:  dfr@render.com
						Phone: +44 171 734 3761
						FAX:   +44 171 734 6426




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.961009111734.10204b-100000>