summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-02-24 15:15:46 +0000
committerkib <kib@FreeBSD.org>2016-02-24 15:15:46 +0000
commit392fea70ccccfb399c24065c3b18ae3f4f2cd8a9 (patch)
treeb1f2fcd1ee3fc1d6ee4f81ac7a505fe770c502c7 /sys/kern/vfs_cache.c
parentfbff7925a133d45c4511f61818c53393501ce9dc (diff)
downloadFreeBSD-src-392fea70ccccfb399c24065c3b18ae3f4f2cd8a9.zip
FreeBSD-src-392fea70ccccfb399c24065c3b18ae3f4f2cd8a9.tar.gz
Provide more correct sizing of the KVA consumed by a vnode, used by
the virtvnodes calculation. Include the size of fs-specific v_data as the nfs nclnode inline, the NFS nclnode is bigger than either ZFS znode or UFS inode. Include the size of namecache_ts and short cache path element, multiplied by the name cache population factor, again inline. Inline defines are used to avoid pollution of the vnode.h with the subsystem-private objects. Non-significant unsynchronized changes of the definitions are fine, we do not care about that precision, and e.g. ZFS consumes much malloced memory per vnode for reasons unaccounted in the formula. Lower the partition of kmem dedicated to vnodes, from 1/7 to 1/10. The measures reduce vnode cache pressure on kmem and bring the vnode cache memory use below some apparent thresholds that were exceeded by r291244 due to more robust vnode reuse. Reported and tested by: marius (i386, previous version) Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r--sys/kern/vfs_cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index ff2ad21..bfed116 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -171,7 +171,7 @@ SYSCTL_ULONG(_debug, OID_AUTO, numcache, CTLFLAG_RD, &numcache, 0,
static u_long numcachehv; /* number of cache entries with vnodes held */
SYSCTL_ULONG(_debug, OID_AUTO, numcachehv, CTLFLAG_RD, &numcachehv, 0,
"Number of namecache entries with vnodes held");
-static u_int ncsizefactor = 2;
+u_int ncsizefactor = 2;
SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0,
"Size factor for namecache");
OpenPOWER on IntegriCloud