Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Oct 2014 22:27:52 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273486 - head/sys/fs/nfsclient
Message-ID:  <201410222227.s9MMRqCI012946@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Wed Oct 22 22:27:51 2014
New Revision: 273486
URL: https://svnweb.freebsd.org/changeset/base/273486

Log:
  Clip the settings for the NFS rsize, wsize mount options
  to a power of 2. For non-power of 2 settings, intermittent
  page faults have been reported. Although the bug that causes
  these page faults/crashes has not been identified, it does
  not appear to occur when rsize, wsize is a power of 2.
  
  Reported by:	tcberner@gmail.com
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clvfsops.c

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvfsops.c	Wed Oct 22 21:57:35 2014	(r273485)
+++ head/sys/fs/nfsclient/nfs_clvfsops.c	Wed Oct 22 22:27:51 2014	(r273486)
@@ -621,17 +621,27 @@ nfs_decode_args(struct mount *mp, struct
 
 	if ((argp->flags & NFSMNT_WSIZE) && argp->wsize > 0) {
 		nmp->nm_wsize = argp->wsize;
-		/* Round down to multiple of blocksize */
-		nmp->nm_wsize &= ~(NFS_FABLKSIZE - 1);
-		if (nmp->nm_wsize <= 0)
+		/*
+		 * Clip at the power of 2 below the size. There is an
+		 * issue (not isolated) that causes intermittent page
+		 * faults if this is not done.
+		 */
+		if (nmp->nm_wsize > NFS_FABLKSIZE)
+			nmp->nm_wsize = 1 << (fls(nmp->nm_wsize) - 1);
+		else
 			nmp->nm_wsize = NFS_FABLKSIZE;
 	}
 
 	if ((argp->flags & NFSMNT_RSIZE) && argp->rsize > 0) {
 		nmp->nm_rsize = argp->rsize;
-		/* Round down to multiple of blocksize */
-		nmp->nm_rsize &= ~(NFS_FABLKSIZE - 1);
-		if (nmp->nm_rsize <= 0)
+		/*
+		 * Clip at the power of 2 below the size. There is an
+		 * issue (not isolated) that causes intermittent page
+		 * faults if this is not done.
+		 */
+		if (nmp->nm_rsize > NFS_FABLKSIZE)
+			nmp->nm_rsize = 1 << (fls(nmp->nm_rsize) - 1);
+		else
 			nmp->nm_rsize = NFS_FABLKSIZE;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410222227.s9MMRqCI012946>