Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 May 2015 07:18:07 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r282363 - stable/9/sys/fs/nfsclient
Message-ID:  <201505030718.t437I7hR097281@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun May  3 07:18:06 2015
New Revision: 282363
URL: https://svnweb.freebsd.org/changeset/base/282363

Log:
  MFC r281738:
  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

Modified:
  stable/9/sys/fs/nfsclient/nfs_clvfsops.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clvfsops.c	Sun May  3 07:16:47 2015	(r282362)
+++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c	Sun May  3 07:18:06 2015	(r282363)
@@ -1265,10 +1265,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;
+
 
 	nfs_decode_args(mp, nmp, argp, hst, cred, td);
 



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