Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4206768iog; Tue, 28 Jun 2022 11:07:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1umjFQ1mD1M7x4EWz0upMZm4cnDTFazOCgIb4w+RubGjrcHQlG5tMpnj7c6nJvpJyGN+kZy X-Received: by 2002:a05:6402:516b:b0:435:8f7b:b6f7 with SMTP id d11-20020a056402516b00b004358f7bb6f7mr24792016ede.291.1656439665512; Tue, 28 Jun 2022 11:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656439665; cv=none; d=google.com; s=arc-20160816; b=wW8/Z70fyizng2GVXq7zx/KqMUZ8Uo4ojNCYMxZjZMWAJYWXWpPEDbIcariMkPzMCe Rtrj6ELa7yn2Gb5ts2UnsbvReD4QpZTh1ZBCHXRwR8rFgNBa5Pn8zH4G0KgnEOjCDFBq SAp5VXzhT+J4KusgXdg+v8WENx2iWogZYV1WYVY5PgvJLyA7KfEkZqJPyW87IVpN4tS7 mptmSasoqDqBMJxWuJ2yosIWF28hJ9G1vjbf4AeTr7JwCZtl09ZYkR/NWg4t2dCqevXd vFFJRqT66FJ7yn5GKb96IEClpWzQspwssj6GiSrzanOj1y16eNgJZ3MCAMVhJG8edMs+ N5YA== 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=iIG8hDibwvoBDk4TT0qx0EeBO2oh/sxyhy7zu8ZD9aM=; b=wQCM37s+H8PYHAEAybqOvv+ezOcVXLNfgIIuH2tnAODA81SnKZ/Td6ndZXI6WsOE3B 3+3zBQRSPZZYeXxdqXSdwu5qT3KrTbm9PnpYvbESRJa0e2lHuHYJiDf44KeFPxGkwgFV 4lMcIO6IbHEqI/d9kZqdS6Si7RJ1izx0wf+91nYFflDItbVS7VNiAIVzW1GCrFuKXW8/ W75e6xBCvdM6rhwotniqiLPrjHJcrkF2armMHtlZPa0yzZA+dk5Rhk/ShXkLDe4C9g48 dRQmaQJcwe1pL7k/tkd7OJsx7il2WCG1vvZIIUzV01If3wjoQtqZCYZGwGVoWXL5ZNfc ++dw== 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 t15-20020a1709064f0f00b00726efd49e61si1482515eju.907.2022.06.28.11.07.19; Tue, 28 Jun 2022 11:07:45 -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 S233918AbiF1SGX (ORCPT + 99 others); Tue, 28 Jun 2022 14:06:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233878AbiF1SGO (ORCPT ); Tue, 28 Jun 2022 14:06:14 -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 16A4C1D335; Tue, 28 Jun 2022 11:06:14 -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 A5C0461A7B; Tue, 28 Jun 2022 18:06:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3735C3411D; Tue, 28 Jun 2022 18:06:12 +0000 (UTC) Subject: [PATCH v2 04/31] NFSD: Report count of freed filecache items 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:11 -0400 Message-ID: <165643957172.84360.1846401511560388071.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 Surface the count of freed nfsd_file items. Signed-off-by: Chuck Lever --- fs/nfsd/filecache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 3359df6c7ac0..c28e9577837d 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -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_acquisitions); +static DEFINE_PER_CPU(unsigned long, nfsd_file_releases); struct nfsd_fcache_disposal { struct work_struct work; @@ -202,6 +203,8 @@ nfsd_file_free(struct nfsd_file *nf) { bool flush = false; + this_cpu_inc(nfsd_file_releases); + trace_nfsd_file_put_final(nf); if (nf->nf_mark) nfsd_file_mark_put(nf->nf_mark); @@ -1070,7 +1073,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 long hits = 0, acquisitions = 0; + unsigned long hits = 0, acquisitions = 0, releases = 0; unsigned int i, count = 0, longest = 0; unsigned long lru = 0; @@ -1092,6 +1095,7 @@ static int nfsd_file_cache_stats_show(struct seq_file *m, void *v) for_each_possible_cpu(i) { hits += per_cpu(nfsd_file_cache_hits, i); acquisitions += per_cpu(nfsd_file_acquisitions, i); + releases += per_cpu(nfsd_file_releases, i); } seq_printf(m, "total entries: %u\n", count); @@ -1099,6 +1103,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, "cache hits: %lu\n", hits); seq_printf(m, "acquisitions: %lu\n", acquisitions); + seq_printf(m, "releases: %lu\n", releases); return 0; }