Commit d6329327 authored by Chuck Lever's avatar Chuck Lever

NFSD: Report count of freed filecache items

Surface the count of freed nfsd_file items.
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 29d4bdbb
...@@ -44,6 +44,7 @@ struct nfsd_fcache_bucket { ...@@ -44,6 +44,7 @@ struct nfsd_fcache_bucket {
static DEFINE_PER_CPU(unsigned long, nfsd_file_cache_hits); static DEFINE_PER_CPU(unsigned long, nfsd_file_cache_hits);
static DEFINE_PER_CPU(unsigned long, nfsd_file_acquisitions); static DEFINE_PER_CPU(unsigned long, nfsd_file_acquisitions);
static DEFINE_PER_CPU(unsigned long, nfsd_file_releases);
struct nfsd_fcache_disposal { struct nfsd_fcache_disposal {
struct work_struct work; struct work_struct work;
...@@ -196,6 +197,8 @@ nfsd_file_free(struct nfsd_file *nf) ...@@ -196,6 +197,8 @@ nfsd_file_free(struct nfsd_file *nf)
{ {
bool flush = false; bool flush = false;
this_cpu_inc(nfsd_file_releases);
trace_nfsd_file_put_final(nf); trace_nfsd_file_put_final(nf);
if (nf->nf_mark) if (nf->nf_mark)
nfsd_file_mark_put(nf->nf_mark); nfsd_file_mark_put(nf->nf_mark);
...@@ -1050,7 +1053,7 @@ nfsd_file_create(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -1050,7 +1053,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) static int nfsd_file_cache_stats_show(struct seq_file *m, void *v)
{ {
unsigned long hits = 0, acquisitions = 0; unsigned long hits = 0, acquisitions = 0, releases = 0;
unsigned int i, count = 0, longest = 0; unsigned int i, count = 0, longest = 0;
unsigned long lru = 0; unsigned long lru = 0;
...@@ -1072,6 +1075,7 @@ static int nfsd_file_cache_stats_show(struct seq_file *m, void *v) ...@@ -1072,6 +1075,7 @@ static int nfsd_file_cache_stats_show(struct seq_file *m, void *v)
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
hits += per_cpu(nfsd_file_cache_hits, i); hits += per_cpu(nfsd_file_cache_hits, i);
acquisitions += per_cpu(nfsd_file_acquisitions, i); acquisitions += per_cpu(nfsd_file_acquisitions, i);
releases += per_cpu(nfsd_file_releases, i);
} }
seq_printf(m, "total entries: %u\n", count); seq_printf(m, "total entries: %u\n", count);
...@@ -1079,6 +1083,7 @@ static int nfsd_file_cache_stats_show(struct seq_file *m, void *v) ...@@ -1079,6 +1083,7 @@ static int nfsd_file_cache_stats_show(struct seq_file *m, void *v)
seq_printf(m, "lru entries: %lu\n", lru); seq_printf(m, "lru entries: %lu\n", lru);
seq_printf(m, "cache hits: %lu\n", hits); seq_printf(m, "cache hits: %lu\n", hits);
seq_printf(m, "acquisitions: %lu\n", acquisitions); seq_printf(m, "acquisitions: %lu\n", acquisitions);
seq_printf(m, "releases: %lu\n", releases);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment