Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4860601iog; Wed, 22 Jun 2022 07:14:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s/K8OspGlcWZFVDUB7Kx8lx00mqHQwl3g1ynphS1nWtTc3PrlRj01Hc1TA1JlSEfDE+wvg X-Received: by 2002:a05:6402:350b:b0:42f:d079:647f with SMTP id b11-20020a056402350b00b0042fd079647fmr4174637edd.321.1655907240899; Wed, 22 Jun 2022 07:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655907240; cv=none; d=google.com; s=arc-20160816; b=k1T2y0Zql3X7pXTUNsbfzGJmOHEYbokIIzc0N0cxrgKEQnTmgb9WCGsNid2pByiWB6 I1s1KyPihsbu3L9Hy/dd3nwIPKH9pfrt9v1isCRRzs9xMIbiPv6u7aPV8pzjatsvTwJy Z9QOtmO4j/KyTxYAcVDkSSyroJyszkpSxqJxMQgS8N/eA7Md9EVgAD8mZkby7iCBLbMR urIJh2ZL5cVgJPlo9g1PTDDvQ0Rw1U2PhSw3LdnNY+eoVTTXex37+83INJCXu981Ty6H bgBOqSenJVyiboyvggE8wVUmjlgEBJCYBVnySsudvjCjj6yhjSTnK/YcexHyNeSLANGm aZJQ== 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:message-id:date:cc:to:from:subject; bh=tzsP9ZVNArdtW2flPLU82XENy4iGqsTiLfZDprJNNKQ=; b=a2jamBit7tyo4krpAzTrEAsgke12uFox4dj8BvjDNQTg5x9rn6bNrJBkgktsUI6UG8 V03427f3uatZKvP44K+6BNW2catOqNzXgJSNNA4j292GVwW81eJVuBIpYPBPm6N/5nUO vgIHeA5VKEIFHFVWDr55PN4tlNg6MImh8MOUh/UiATYubdrl80TJ2SoTc8GYmR5/PcHG ceLeumlbue2A6biNLCWgZ882+X8BigsAM1LKoICbeu5hPINE7negSEd2F8FqtEAr8VzY kp1HvShITmMieyaoKtqIbvDfmr29i37MBc57gS28qSGgy75G2sooUkabuBSJ73kFPrA/ DIkg== 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 kk24-20020a170907767800b006fee7b723e5si3352560ejc.470.2022.06.22.07.13.31; Wed, 22 Jun 2022 07:14:00 -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 S1357996AbiFVOMt (ORCPT + 99 others); Wed, 22 Jun 2022 10:12:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357924AbiFVOMt (ORCPT ); Wed, 22 Jun 2022 10:12:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 713C438DBE; Wed, 22 Jun 2022 07:12:48 -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 167AE61B8D; Wed, 22 Jun 2022 14:12:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 161FDC34114; Wed, 22 Jun 2022 14:12:47 +0000 (UTC) Subject: [PATCH RFC 00/30] Overhaul NFSD filecache 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:12:45 -0400 Message-ID: <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 This series overhauls the NFSD filecache, a cache of server-side "struct file" objects recently used by NFS clients. The purposes of this overhaul are an immediate improvement in cache scalability in the number of open files, and preparation for further improvements. There are three categories of patches in this series: 1. Add observability of cache operation so we can see what we're doing as changes are made to the code. 2. Improve the scalability of filecache garbage collection, addressing several bugs along the way. 3. Improve the scalability of the filecache hash table by converting it to use rhashtable. The series as it stands survives typical test workloads. Running stress-tests like generic/531 is the next step. These patches are also available in the linux-nfs-bugzilla-386 branch of https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git --- Chuck Lever (30): NFSD: Report filecache LRU size NFSD: Report count of calls to nfsd_file_acquire() NFSD: Report count of freed filecache items NFSD: Report average age of filecache items NFSD: Add nfsd_file_lru_dispose_list() helper NFSD: Refactor nfsd_file_gc() NFSD: Refactor nfsd_file_lru_scan() NFSD: Report the number of items evicted by the LRU walk NFSD: Record number of flush calls NFSD: Report filecache item construction failures NFSD: Zero counters when the filecache is re-initialized NFSD: Hook up the filecache stat file NFSD: WARN when freeing an item still linked via nf_lru NFSD: Trace filecache LRU activity NFSD: Leave open files out of the filecache LRU NFSD: Fix the filecache LRU shrinker NFSD: Never call nfsd_file_gc() in foreground paths NFSD: No longer record nf_hashval in the trace log NFSD: Remove lockdep assertion from unhash_and_release_locked() NFSD: nfsd_file_unhash can compute hashval from nf->nf_inode NFSD: Refactor __nfsd_file_close_inode() NFSD: nfsd_file_hash_remove can compute hashval NFSD: Remove nfsd_file::nf_hashval NFSD: Remove stale comment from nfsd_file_acquire() NFSD: Clean up "open file" case in nfsd_file_acquire() NFSD: Document nfsd_file_cache_purge() API contract NFSD: Replace the "init once" mechanism NFSD: Set up an rhashtable for the filecache NFSD: Convert the filecache to use rhashtable NFSD: Clean up unusued code after rhashtable conversion fs/nfsd/filecache.c | 677 +++++++++++++++++++++++++++----------------- fs/nfsd/filecache.h | 6 +- fs/nfsd/nfsctl.c | 10 + fs/nfsd/trace.h | 117 ++++++-- 4 files changed, 522 insertions(+), 288 deletions(-) -- Chuck Lever