Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4206792iog; Tue, 28 Jun 2022 11:07:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sWUa2FbSyChrKKLyVYvo/tR5Z4W120qAiiJpelkVpwQbZG0vjmGrhHC6nfFo2ralvXndCU X-Received: by 2002:a05:6a00:23ca:b0:525:28b4:9e3b with SMTP id g10-20020a056a0023ca00b0052528b49e3bmr4688422pfc.43.1656439667109; Tue, 28 Jun 2022 11:07:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656439667; cv=none; d=google.com; s=arc-20160816; b=EEcOdAuOMb6AjzP8fVWAv7tBEgsal8iENLvgT5A6KS+9J1+O/UTpqmKXn+KjxCnfGZ E0EpwRRcwxzrp9KJEefihglSdoDLbxGbfZvzxzzVGHfsoGhfud77j3st8fMvoUq8vO2r TBdYkLW3wbAjsY2V3EIDwufxapsTVoDaQ7wjQd6g5PWi86vQySASyXCnvdKC6uxOfjQy gsG3o86DMFvi5v9i1kaCBBF6m8PVx40gh4/NY4SdoKZPEreSGTue8wrBsTi05+amRbo8 V+bv8I43lCz19OUrMG1YyPRImnZGCTZaj85KUD377n658xRlcgcBO16XCC2hTeE63QdK XcGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject; bh=GIhHdJxNTWB7KzExHSYn+Sl/50pzAbpiuw6YQZB+r20=; b=ChK09rxGm3DRQjLzXMQ7gWdAU+fBbfJVNO/e7eQUvTS5ykT1y8r7Rz3tO+GyZwHMGj 90uj7CmajwRFJZ9ICFTBsshLUnchaz5D8rTcQohZ2sHqJxbQQQaPeAep8CLb5vOC1Kr2 kCAVOBXjAj9dpCWP9KNiOk2H6Wh08H2yYSuOLLDKPibXPtIxLh1gIKqmkz/lsGzWZNir INMfCuEXOt/GmH6BmuWvS7XMQdP3z/5FZr5YrfR24PaUpTR1bVcSEl+UMypf+s5PLq03 +znHcwWfzHigh4Z/sOLl8cSvee0RYnVzwHSHinsYkplhD3JZSKN++ofPbr7oOY8Kpwc5 FtJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a1709026ac500b001678adeceecsi12299176plt.384.2022.06.28.11.07.35; Tue, 28 Jun 2022 11:07:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233956AbiF1SHB (ORCPT + 99 others); Tue, 28 Jun 2022 14:07:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233952AbiF1SHA (ORCPT ); Tue, 28 Jun 2022 14:07:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC8E31DA79; Tue, 28 Jun 2022 11:06:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8BAA961ADD; Tue, 28 Jun 2022 18:06:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0A70C3411D; Tue, 28 Jun 2022 18:06:58 +0000 (UTC) Subject: [PATCH v2 11/31] NFSD: Zero counters when the filecache is re-initialized From: Chuck Lever To: linux-nfs@vger.kernel.org, netdev@vger.kernel.org Cc: david@fromorbit.com, jlayton@redhat.com, tgraf@suug.ch Date: Tue, 28 Jun 2022 14:06:57 -0400 Message-ID: <165643961771.84360.11939022369957909175.stgit@manet.1015granger.net> In-Reply-To: <165643915086.84360.2809940286726976517.stgit@manet.1015granger.net> References: <165643915086.84360.2809940286726976517.stgit@manet.1015granger.net> User-Agent: StGit/1.5.dev2+g9ce680a5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If nfsd_file_cache_init() is called after a shutdown, be sure the stat counters are reset. Signed-off-by: Chuck Lever --- fs/nfsd/filecache.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 7b532449b93f..3055a04eeabe 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -830,6 +830,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); @@ -853,6 +855,15 @@ nfsd_file_cache_shutdown(void) nfsd_file_hashtbl = NULL; destroy_workqueue(nfsd_filecache_wq); nfsd_filecache_wq = NULL; + + for_each_possible_cpu(i) { + per_cpu(nfsd_file_cache_hits, i) = 0; + per_cpu(nfsd_file_acquisitions, i) = 0; + per_cpu(nfsd_file_releases, i) = 0; + per_cpu(nfsd_file_total_age, i) = 0; + per_cpu(nfsd_file_pages_flushed, i) = 0; + per_cpu(nfsd_file_evictions, i) = 0; + } } static bool