svn commit: r281738 - head/sys/fs/nfsclient

Alexander Motin mav at FreeBSD.org
Sun Apr 19 11:34:42 UTC 2015


Author: mav
Date: Sun Apr 19 11:34:41 2015
New Revision: 281738
URL: https://svnweb.freebsd.org/changeset/base/281738

Log:
  Change wcommitsize default from one empirical value to another.
  
  The new value is more predictable with growing RAM size:
  
          hibufspace maxvnodes      old      new
  i386:
    256MB   32980992     15800  2198732  2097152
      2GB   94027776    107677   878764  4194304
  amd64:
    256MB   32980992     15800  2198732  2097152
      1GB  114114560     68062  1678155  4194304
      4GB  217055232    111807  1955452  4194304
     16GB 1717846016    337308  5097465 16777216
     64GB 1734918144   1164427  1490479 16777216
    256GB 1734918144   4426453   391983 16777216
  
  Reviewed by:	rmacklem
  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	Sun Apr 19 10:47:55 2015	(r281737)
+++ head/sys/fs/nfsclient/nfs_clvfsops.c	Sun Apr 19 11:34:41 2015	(r281738)
@@ -1324,10 +1324,13 @@ mountnfs(struct nfs_args *argp, struct m
 	nmp->nm_timeo = NFS_TIMEO;
 	nmp->nm_retry = NFS_RETRANS;
 	nmp->nm_readahead = NFS_DEFRAHEAD;
-	if (desiredvnodes >= 11000)
-		nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000);
-	else
-		nmp->nm_wcommitsize = hibufspace / 10;
+
+	/* This is empirical approximation of sqrt(hibufspace) * 256. */
+	nmp->nm_wcommitsize = NFS_MAXBSIZE / 256;
+	while ((long)nmp->nm_wcommitsize * nmp->nm_wcommitsize < hibufspace)
+		nmp->nm_wcommitsize *= 2;
+	nmp->nm_wcommitsize *= 256;
+
 	if ((argp->flags & NFSMNT_NFSV4) != 0)
 		nmp->nm_minorvers = minvers;
 	else


More information about the svn-src-all mailing list