summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/filecache.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2022-07-08 14:23:52 -0400
committerChuck Lever <chuck.lever@oracle.com>2022-07-29 20:09:21 -0400
commit0fd244c115f0321fc5e34ad2291f2a572508e3f7 (patch)
treed50820a05f567734d3e0ccc73ee2cea215e7b471 /fs/nfsd/filecache.c
parentca3f9acb6d3faf78da2b63324f7c737dbddf7f69 (diff)
downloadlinux-0fd244c115f0321fc5e34ad2291f2a572508e3f7.tar.bz2
NFSD: Report filecache LRU size
Surface the NFSD filecache's LRU list length to help field troubleshooters monitor filecache issues. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/filecache.c')
-rw-r--r--fs/nfsd/filecache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index e1f98d32cee1..c61c1cf32346 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -1048,7 +1048,7 @@ nfsd_file_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
static int nfsd_file_cache_stats_show(struct seq_file *m, void *v)
{
unsigned int i, count = 0, longest = 0;
- unsigned long hits = 0;
+ unsigned long lru = 0, hits = 0;
/*
* No need for spinlocks here since we're not terribly interested in
@@ -1061,6 +1061,7 @@ static int nfsd_file_cache_stats_show(struct seq_file *m, void *v)
count += nfsd_file_hashtbl[i].nfb_count;
longest = max(longest, nfsd_file_hashtbl[i].nfb_count);
}
+ lru = list_lru_count(&nfsd_file_lru);
}
mutex_unlock(&nfsd_mutex);
@@ -1069,6 +1070,7 @@ static int nfsd_file_cache_stats_show(struct seq_file *m, void *v)
seq_printf(m, "total entries: %u\n", count);
seq_printf(m, "longest chain: %u\n", longest);
+ seq_printf(m, "lru entries: %lu\n", lru);
seq_printf(m, "cache hits: %lu\n", hits);
return 0;
}