Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp773041imw; Fri, 8 Jul 2022 11:24:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sg6TSTR3GKj5T7HTLmUwqpMKU26KQvY5Cm/A3F0kEO5umtCPjkEipylpBZLjtFe9I8lADH X-Received: by 2002:a17:90b:4f48:b0:1ed:45e5:dc8c with SMTP id pj8-20020a17090b4f4800b001ed45e5dc8cmr1253745pjb.131.1657304687418; Fri, 08 Jul 2022 11:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657304687; cv=none; d=google.com; s=arc-20160816; b=cSCbz5V1lbVfHXcrqLpLAG+K2NYFBhlTpZkRs3Po1oLyAlKPeFjSH3WbeAY2uLGVmW EwWQbBpK7/4wPDCcFzxLZ7yBPrnaZqIuHduZxDgdT8OOQUN5ejt+fzf/oyXJujZvFCsU AS4AsxH1/702pfRXr42Tu+Yu1gKZfBM/C/OVYtC1ymQBH/yF03Vg0I7OX5oygHLVb4oC UV7x4pabbLZcXd2zC7Rh1oRyb20BeRdvJ9lGOJkuivUXlEE4KrvaUyoCqMYrchFYa20u s4T3a+JHDkIF0eR/4x+B/5CW/32JrJGwc7jMIuYLVAKSh/+JbXOAC4W4bIWe+YF4FLnC 0wlw== 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=yZiTLFrs+J1JqYDOnHhhNZ8Lj8448HrTidjM4FMTONI=; b=MTyTYa86qdNSFwS1HtYiSyfbTl/JsxqNrsmf/BptnP3oJ4yia7k0vQ88+YLsdhBW9T wn2iBX7bkZ8QoYdKKo9yBBX5rVcWafXyZKWHuQG1fzEPCGoD/wy8D4sMT7xTaR3/U/d0 vsQSwtvPr584kNlH5yclvTRJsJhvuqgZbkoTywUZmh2zXUNmi35/4yEiLBOaXCTCEqIY JWFg6+WpEP8fTxEG18HxI067DOd8TgINXYLg58GDcn+FGN7uPakV8vupTMxUfHRIIZkl 4TzRfussJLRQ4z4/vWHs10G5TpNF2rbo/GX6ISjTzCp8k2NVsrD315qshKu7W2q7mnB4 N4lw== 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 n16-20020a170902e55000b0016754f4f654si759913plf.529.2022.07.08.11.24.35; Fri, 08 Jul 2022 11:24: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 S239418AbiGHSYB (ORCPT + 99 others); Fri, 8 Jul 2022 14:24:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239492AbiGHSXz (ORCPT ); Fri, 8 Jul 2022 14:23:55 -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 E36671EC52; Fri, 8 Jul 2022 11:23:54 -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 6EE7262474; Fri, 8 Jul 2022 18:23:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B266C341C0; Fri, 8 Jul 2022 18:23:53 +0000 (UTC) Subject: [PATCH v3 02/32] NFSD: Report filecache LRU size 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:23:52 -0400 Message-ID: <165730463235.28142.14209014620135692603.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 NFSD filecache's LRU list length to help field troubleshooters monitor filecache issues. Signed-off-by: Chuck Lever --- fs/nfsd/filecache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 9cb2d590c036..a0234d194ec1 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -1068,7 +1068,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 int i, count = 0, longest = 0; - unsigned long hits = 0; + unsigned long lru = 0, hits = 0; /* * No need for spinlocks here since we're not terribly interested in @@ -1081,6 +1081,7 @@ static int nfsd_file_cache_stats_show(struct seq_file *m, void *v) count += nfsd_file_hashtbl[i].nfb_count; longest = max(longest, nfsd_file_hashtbl[i].nfb_count); } + lru = list_lru_count(&nfsd_file_lru); } mutex_unlock(&nfsd_mutex); @@ -1089,6 +1090,7 @@ static int nfsd_file_cache_stats_show(struct seq_file *m, void *v) seq_printf(m, "total entries: %u\n", count); seq_printf(m, "longest chain: %u\n", longest); + seq_printf(m, "lru entries: %lu\n", lru); seq_printf(m, "cache hits: %lu\n", hits); return 0; }