summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-04-19 11:34:41 +0000
committermav <mav@FreeBSD.org>2015-04-19 11:34:41 +0000
commitd9ba2b8e840dee9f2a11552ae25b13cbf7acd2aa (patch)
tree74d51f92847e5b7078c3b760814b492a6f41c816 /sys/fs
parent9e3dd6e843273a2394b666326f7de6f6a5ef084e (diff)
downloadFreeBSD-src-d9ba2b8e840dee9f2a11552ae25b13cbf7acd2aa.zip
FreeBSD-src-d9ba2b8e840dee9f2a11552ae25b13cbf7acd2aa.tar.gz
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
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 f6f9f23..964ea1f 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -1324,10 +1324,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