Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4205416iog; Tue, 28 Jun 2022 11:06:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1swhkbZcVHwgZMNXq9sMohG25ne0a7kgI1hTp0TgUsATh7WlbhEYfhXCsgsAfGgfprykX/I X-Received: by 2002:a63:7e45:0:b0:40c:8f6a:4d94 with SMTP id o5-20020a637e45000000b0040c8f6a4d94mr18215266pgn.562.1656439577842; Tue, 28 Jun 2022 11:06:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656439577; cv=none; d=google.com; s=arc-20160816; b=mfjqP4rhYmXg0vj4wJfQMsItKGgeDE0IUDrY8C8TRV1nr7pJGXMSZJ+UHQ2G23xQRl 2PIp4WASpnM+Ag7uEU7jpEh8oEPzH4OGrZlU3/hvKrnkRRtTnpEqLJ0NY3uYnfHz+hvK 9gHaEfeGJ7rQkyiXG6gdHPM91F70pnizdtMxK/cKLY9DU9wPw1XPugRqcAUIgRjtGAUJ dqDkKC6tfmFMFxBtEDBcyyvxVdR79ShbbEOiaxWJIoh1DrMQ6prWWAEtUaO1/QNzr60h rNGkv9nxxDuDMWTQaSZ8a7saUehvxeFRUR+p33JMjvjDNPqpaDvkg5t5DQj0rLJ/zghj aU5A== 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=DkG6si41R/WYrdJbX7NSFPLPq3ra8xsjFeilDAvjrrA=; b=OPavJIyhKHneImWpaAixb/RExhYxQ3CoE3MM+wKNGhaPlb9RDbkRn4NIMLu4v+LuwW YTgMKJHLSactkq2LfNlYwx3y14qhe13jIGYvRFiFUU/P2eUJmsqIpIvKbfZxqEYhmy+u lVppyun56X+DzD6uWCKG9tTPqcEx/UxjX27K9twZJQETjJSkDquYUyByJ4+2cBsW7EW2 hmUL9HThHhUpt58qvFEUJ+Is7MiYtVA0Q7wGUu590XYWTtbv/h7pR5QeNLZqab2iix3B tjWWebIT8VYqmRGWosyezwCqoYoo5RaWdM9o8N9zNjS/GZe2n6YXP1DigaO6GiK1+aHa 2GGQ== 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 h14-20020a170902ac8e00b00163eff0e71esi18592487plr.572.2022.06.28.11.06.02; Tue, 28 Jun 2022 11:06:17 -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 S231517AbiF1SFv (ORCPT + 99 others); Tue, 28 Jun 2022 14:05:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230079AbiF1SFu (ORCPT ); Tue, 28 Jun 2022 14:05:50 -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 A001E1C923; Tue, 28 Jun 2022 11:05:49 -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 61A85B81F55; Tue, 28 Jun 2022 18:05:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B693BC3411D; Tue, 28 Jun 2022 18:05:46 +0000 (UTC) Subject: [PATCH v2 00/31] Overhaul NFSD filecache 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:05:45 -0400 Message-ID: <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 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. 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 Changes since RFC: - Fixed several crashers - Adjusted some of the new observability - Tests with generic/531 now pass - Fixed bugzilla 387 too, maybe - Plenty of clean-ups --- Chuck Lever (31): NFSD: Demote a WARN to a pr_warn() 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: 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: Replace the "init once" mechanism NFSD: Set up an rhashtable for the filecache NFSD: Convert the filecache to use rhashtable NFSD: Clean up unused code after rhashtable conversion NFSD: Separate tracepoints for acquire and create NFSD: Move nfsd_file_trace_alloc() tracepoint NFSD: Update the nfsd_file_fsnotify_handle_event() tracepoint NFSD: NFSv4 CLOSE should release an nfsd_file immediately fs/nfsd/filecache.c | 715 ++++++++++++++++++++++++-------------- fs/nfsd/filecache.h | 7 +- fs/nfsd/nfs4proc.c | 6 +- fs/nfsd/nfs4state.c | 5 +- fs/nfsd/nfsctl.c | 10 + fs/nfsd/trace.h | 300 +++++++++++++--- include/trace/events/fs.h | 37 ++ 7 files changed, 766 insertions(+), 314 deletions(-) -- Chuck Lever