From 3929eca769b5a231010b4978acc61c0735da198f Mon Sep 17 00:00:00 2001 From: David Howells Date: Thu, 21 Oct 2021 21:58:29 +0100 Subject: fscache, cachefiles: Display stats of no-space events Add stat counters of no-space events that caused caching not to happen and display in /proc/fs/fscache/stats. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819653216.215744.17210522251617386509.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906958369.143852.7257100711818401748.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967166917.1823006.14842444049198947892.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021566184.640689.4417328329632709265.stgit@warthog.procyon.org.uk/ # v4 --- fs/fscache/stats.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fs/fscache') diff --git a/fs/fscache/stats.c b/fs/fscache/stats.c index 798ee68b3e9d..db2f4e225dd9 100644 --- a/fs/fscache/stats.c +++ b/fs/fscache/stats.c @@ -42,6 +42,10 @@ atomic_t fscache_n_read; EXPORT_SYMBOL(fscache_n_read); atomic_t fscache_n_write; EXPORT_SYMBOL(fscache_n_write); +atomic_t fscache_n_no_write_space; +EXPORT_SYMBOL(fscache_n_no_write_space); +atomic_t fscache_n_no_create_space; +EXPORT_SYMBOL(fscache_n_no_create_space); /* * display the general statistics @@ -82,6 +86,10 @@ int fscache_stats_show(struct seq_file *m, void *v) atomic_read(&fscache_n_relinquishes_retire), atomic_read(&fscache_n_relinquishes_dropped)); + seq_printf(m, "NoSpace: nwr=%u ncr=%u\n", + atomic_read(&fscache_n_no_write_space), + atomic_read(&fscache_n_no_create_space)); + seq_printf(m, "IO : rd=%u wr=%u\n", atomic_read(&fscache_n_read), atomic_read(&fscache_n_write)); -- cgit v1.2.3