summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-05-03 07:16:47 +0000
committermav <mav@FreeBSD.org>2015-05-03 07:16:47 +0000
commitf8c0ace4a438e015e987685a71e81a966baa7b1d (patch)
tree6125fe1f6d376bc1a9ef366e7bf027447221bc78 /sys/fs
parentbd39d936dfe7fe81422ef32e7b3cbfcfeb51b3e1 (diff)
downloadFreeBSD-src-f8c0ace4a438e015e987685a71e81a966baa7b1d.zip
FreeBSD-src-f8c0ace4a438e015e987685a71e81a966baa7b1d.tar.gz
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
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
index 6ce469d..36f02f0 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -1319,10 +1319,13 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
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
OpenPOWER on IntegriCloud