Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp773057imw; Fri, 8 Jul 2022 11:24:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vz4QxFZ5f4vRGbbm+rbWj8GgSHr2qRQbZ2QgtuiSwHsB+IDcR44iErIzWuOp9puoooz6FJ X-Received: by 2002:a17:902:ef8e:b0:16b:e594:10d7 with SMTP id iz14-20020a170902ef8e00b0016be59410d7mr4774259plb.164.1657304688416; Fri, 08 Jul 2022 11:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657304688; cv=none; d=google.com; s=arc-20160816; b=XUNTDWOw1AFjsvDYpVeihoW6T8kULKOQMs+bFUKgQ5IrvN7q3BplihgbT7x71v1pzh DiwUCwnhA3+bDZJ+5ZFturu1QQGx7l5itmJwgzhGJrHioNz0lTEIUU2JMm/LvBD4BupW tfX6XW+3Cat6zOR5On+1M2qStqniAUFR+3Toq4PryCTQ5F3JazkhGpOQtcq0VenqsrzX K4nh9tWCb2spFOh9yj9j85Q+/F91R5snB9n1SVY56HeGhmIqnI5+QX4A0oBIRd/VkicI UVjG/1D7oGN/o3L5sjxmy3cK59SbuaL8ze5iKqF6fCyHPLybC7JZLEaOlirbLPi/PNzy UWCg== 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=vtrp+UWCx1QHEafQOnKXOBMvV5IEVem53t8kxpzyyEzD5sZUrHgX8CDvRtZ9RHq2zN h340NrlY1DsM2NaMApPlbZOeLFS5FvOoUpnVLuwUe7MVffUF/OmzeITAZOnLHsoze/iS AN6Uz+a6HD0zhXgOSSlVMiXd+3u8FQmD9xnt5ZnKw24qeJTrNB+3cUf9VKLNU5rL9YSi rS2bkMDgP9vReTA+ypv5xieDDuTBp4hqY8CjdL03ljZ32UdFQN5mtnzXkCGdJPjij0rw jjLwg33d58pggGhfwrnMoYVzl11wMvydQ3aP+GVJAAa0n1xzwezF6Fziyv9Jzb8SP79B P3kA== 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 q66-20020a632a45000000b00410ac395252si36148640pgq.512.2022.07.08.11.24.35; Fri, 08 Jul 2022 11:24:48 -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 S239210AbiGHSYJ (ORCPT + 99 others); Fri, 8 Jul 2022 14:24:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238719AbiGHSYI (ORCPT ); Fri, 8 Jul 2022 14:24:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 145C4E036; Fri, 8 Jul 2022 11:24:08 -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 9A87E62474; Fri, 8 Jul 2022 18:24:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB6DFC341C0; Fri, 8 Jul 2022 18:24:06 +0000 (UTC) Subject: [PATCH v3 04/32] 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: Fri, 08 Jul 2022 14:24:05 -0400 Message-ID: <165730464571.28142.4278861288638395918.stgit@klimt.1015granger.net> In-Reply-To: <165730437087.28142.6731645688073512500.stgit@klimt.1015granger.net> References: <165730437087.28142.6731645688073512500.stgit@klimt.1015granger.net> User-Agent: StGit/1.5.dev3+g9561319 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; }