aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-07-14 21:17:08 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-07-14 21:17:08 +0000
commit4516c7eed9b362066b4529ef8d3cd024b6bd4535 (patch)
tree7bf9c1d55d31e41258845bc531e90cf81d4444e4
parent654e644e80ca24a067c93f09c8276b3647acdb21 (diff)
downloadsrc-4516c7eed9b362066b4529ef8d3cd024b6bd4535.tar.gz
src-4516c7eed9b362066b4529ef8d3cd024b6bd4535.zip
cache: count dropped entries
Notes
Notes: svn path=/head/; revision=363200
-rw-r--r--sys/kern/vfs_cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index b3444a016809..6ac718a59d3f 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -408,6 +408,7 @@ STATNODE_ULONG(numneg, "Number of negative cache entries");
STATNODE_ULONG(numcache, "Number of cache entries");
STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held");
STATNODE_COUNTER(numcalls, "Number of cache lookups");
+STATNODE_COUNTER(numdrops, "Number of dropped entries due to reaching the limit");
STATNODE_COUNTER(dothits, "Number of '.' hits");
STATNODE_COUNTER(dotdothits, "Number of '..' hits");
STATNODE_COUNTER(numchecks, "Number of checks in lookup");
@@ -1853,6 +1854,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp,
lnumcache = atomic_fetchadd_long(&numcache, 1) + 1;
if (__predict_false(lnumcache >= ncsize)) {
atomic_add_long(&numcache, -1);
+ counter_u64_add(numdrops, 1);
return;
}