[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <165590723860.75778.13700894228554322207.stgit@manet.1015granger.net>
Date: Wed, 22 Jun 2022 10:13:58 -0400
From: Chuck Lever <chuck.lever@...cle.com>
To: linux-nfs@...r.kernel.org, netdev@...r.kernel.org
Cc: david@...morbit.com, tgraf@...g.ch, jlayton@...hat.com
Subject: [PATCH RFC 11/30] NFSD: Zero counters when the filecache is
re-initialized
If nfsd_file_cache_init() is called after a shutdown, be sure the
stat counters are reset.
Signed-off-by: Chuck Lever <chuck.lever@...cle.com>
---
fs/nfsd/filecache.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index a2a78163bf8d..0cf2e44e874f 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -832,6 +832,8 @@ nfsd_file_cache_shutdown_net(struct net *net)
void
nfsd_file_cache_shutdown(void)
{
+ int i;
+
set_bit(NFSD_FILE_SHUTDOWN, &nfsd_file_lru_flags);
lease_unregister_notifier(&nfsd_file_lease_notifier);
@@ -855,6 +857,15 @@ nfsd_file_cache_shutdown(void)
nfsd_file_hashtbl = NULL;
destroy_workqueue(nfsd_filecache_wq);
nfsd_filecache_wq = NULL;
+
+ for_each_possible_cpu(i) {
+ this_cpu_write(nfsd_file_cache_hits, 0);
+ this_cpu_write(nfsd_file_acquisitions, 0);
+ this_cpu_write(nfsd_file_releases, 0);
+ this_cpu_write(nfsd_file_evictions, 0);
+ this_cpu_write(nfsd_file_pages_flushed, 0);
+ this_cpu_write(nfsd_file_cons_fails, 0);
+ }
}
static bool
Powered by blists - more mailing lists