Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4861349iog; Wed, 22 Jun 2022 07:14:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u7f/6bFLfyKy+Z11X7HAvrjC0c9lEZoJrMgufAEpDcbYo45lOsxZ0rN4L6U8PAK2rddgX4 X-Received: by 2002:a17:907:3e03:b0:722:e694:438 with SMTP id hp3-20020a1709073e0300b00722e6940438mr3527130ejc.755.1655907280197; Wed, 22 Jun 2022 07:14:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655907280; cv=none; d=google.com; s=arc-20160816; b=t4UBiiz/TrJ/QA7hDXSTQMHbMBBCVwmQJ+s6OPjoOmWmFSQltinBQjkaY2pr9X1s0j r/F3EagdB/KOu1tztMNa0nl2LMxOLZJuDTa6uiohsIMvumScQem7ddgS2MS53XND5nv2 aWOviyd3iqwBxcgs0WTpzPyDhGxE0dLZhj02u7QiUDkQhHS7d162lhv38i7oekI1gV5G M2+Z0xxw/t/nko8hI3d8IfFY/U7qhfzH2c58595JEN3Z+mYjMbPSGHc537F1S28wSB1n HbY4Rw/4WdRdpnXF9IbfLfcgjMssVx2Dxt/HJMjATIK+q1Fg4pNS7X+5Nv2yfOyGXT4u OZOw== 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=NTBN6RC7R7coC7gGj+4BJTa+BcXh2Hb7KsctbMSK+PQ=; b=vT1Nyh2Cqkh88CxMfRcK5p6aCHH/eBP/B06fEt0ibQw60Vf4zGoCC1UQ4PFnHHB85J RV8Vl3cLkPkJVyKm7/3qUTKOAVseZaKPmCQGMIh8uxsYgtvEXdhmY9FURjtoSwILyxpU 1LY8jzXUmb0KpZpyS1eICF3gQZ0YiSYN282u+4XyPj147SvgAugt+R5x5x1azRYQsDLK Bme152HCE6onMHERcUoUy5+JedDuKTluWv/Dahgi33Eh/oXLd97ws/ff/hx8tvfC/rHw zh+4Y+KctSHGpdl0MMK05iPo0DJ+LVo/Qcqe8pcAdmHg/CxVPp5bBJNlHD7bH92fxvSX h+kA== 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 5-20020a170906014500b006fee525b18fsi18736107ejh.367.2022.06.22.07.14.12; Wed, 22 Jun 2022 07:14:40 -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 S1358049AbiFVONU (ORCPT + 99 others); Wed, 22 Jun 2022 10:13:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358103AbiFVONM (ORCPT ); Wed, 22 Jun 2022 10:13:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F7AFBCAD; Wed, 22 Jun 2022 07:13:10 -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 ams.source.kernel.org (Postfix) with ESMTPS id B0BCBB81F2D; Wed, 22 Jun 2022 14:13:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0863AC341C7; Wed, 22 Jun 2022 14:13:06 +0000 (UTC) Subject: [PATCH RFC 03/30] NFSD: Report count of freed filecache items From: Chuck Lever To: linux-nfs@vger.kernel.org, netdev@vger.kernel.org Cc: david@fromorbit.com, tgraf@suug.ch, jlayton@redhat.com Date: Wed, 22 Jun 2022 10:13:05 -0400 Message-ID: <165590718591.75778.16486861214249067569.stgit@manet.1015granger.net> In-Reply-To: <165590626293.75778.9843437418112335153.stgit@manet.1015granger.net> References: <165590626293.75778.9843437418112335153.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 128e8934f12a..f735f91e576b 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; /* @@ -1090,6 +1093,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); @@ -1097,6 +1101,7 @@ static int nfsd_file_cache_stats_show(struct seq_file *m, void *v) seq_printf(m, "lru entries: %lu\n", list_lru_count(&nfsd_file_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; }