Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3973193pxb; Mon, 21 Feb 2022 09:21:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8912mNwhMM2e4MRuigE0p/KdbOozxm5z1kV7qFIttRqyzgCaz69rbZehfxeVymyKrwp4/ X-Received: by 2002:a05:6402:2344:b0:3fd:be28:f435 with SMTP id r4-20020a056402234400b003fdbe28f435mr22413117eda.377.1645464067483; Mon, 21 Feb 2022 09:21:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645464067; cv=none; d=google.com; s=arc-20160816; b=YrLwhyW/IddL6hgvQPN2iTpCdhfJ6rrgC101hqyrhml4nB1laaS8Yrqk1/bBM2t5wc uDIW/09tJcGf57EujIOBukWrb6Dbf14zj65pox16+lLWKRBjwLByooTVMKNCtM/T6ahA eMKbOru96cHEDIwYtiCYiunkM5tYZp3Fd/iT/wR9WGF5ne2D0gEQgNctDgUKxoBwvKAr KUCSFTxj7sVcy351khWlBdMjpu/mcIRCcvuouxGgzSnj5yTtnk13kGEEIe1dp/oNqX80 IOJmoUxQYymvxyMxOmV95kPdShuKp4PVP/MNwcE+L/sJGcvr2VTLdiemtjtr83XltuKK zO1Q== 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 :message-id:date:subject:to:from:dkim-signature; bh=1q2SQq6+71GEAX4pHRnEH0vZkaHxfny/Os1o3Z9vEuc=; b=sgvajS/JpqAVbpgxksYWvqFQwUVRGe2Y3QXP/CjID4t/SjbfkzZcVZsAcRko5oiBM4 +4pSXrDd80w3hz5QXDDYWsDUp99/dUNmSpshDqnfByIdJpp0czyDNh4bFVAF3imYgPsj LoDSwpZSimnK6y4irDjxJLR8BKO27NMKqh6RsRI6A/r4v4s4diG/sNQnHNLvIiHJ4722 2eXVuKviLdqQRAlQJHugHJeOmdAf1l2LnXv7va26zUhdOYtQsuQqJqTQn1MnxJUaWwNy 4/V4esw520cPYip5A33XBM95xQKdpqZWCo9YMqNMm/q87jJ6h7rfGUL0rUWWsYfnMIKl oQ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oeJKwQgR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc14si11291416ejc.572.2022.02.21.09.20.34; Mon, 21 Feb 2022 09:21:07 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oeJKwQgR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379978AbiBUQPY (ORCPT + 99 others); Mon, 21 Feb 2022 11:15:24 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379977AbiBUQPY (ORCPT ); Mon, 21 Feb 2022 11:15:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61E5F23BD4 for ; Mon, 21 Feb 2022 08:15:00 -0800 (PST) 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 DC6F861295 for ; Mon, 21 Feb 2022 16:14:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BEDBC340E9 for ; Mon, 21 Feb 2022 16:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645460099; bh=LOLPvtUD+EhS7T1c0wX7yUcN9uOBW4TN6vov7vzKi7U=; h=From:To:Subject:Date:From; b=oeJKwQgRbHSZn4cQpKxXzq+ME+y1Oj2+PQvQdrioarcHLq0oL/M+bdpI7sSq7cPds g1cIzV0Zv37ueLljSMrk9L31qYAwEA2P7rONw8bywTODlSXduOcwuqVK9K9QeJZ6gL I+E0O5wwXKruMP7/qBLcj8TPmEc7e7IorHR2bXNnpVxiDIR/9OACbge/SdW2LKqSQJ 5uAy0VYSCa+wUg2nJwRJ6BWPD7xsUbOHOFPBIXsx2BXNJLms29WNuxWKcrqaQmhLwG jGf2LWQxGOdFlVyLzivz30vM97D+qXMaKANavS7DsucCHSYx6Jk9CJTyCvOiVsEn1Y BRfcBbXZ3liHw== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH v6 00/13] Readdir improvements Date: Mon, 21 Feb 2022 11:08:38 -0500 Message-Id: <20220221160851.15508-1-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 From: Trond Myklebust The current NFS readdir code will always try to maximise the amount of readahead it performs on the assumption that we can cache anything that isn't immediately read by the process. There are several cases where this assumption breaks down, including when the 'ls -l' heuristic kicks in to try to force use of readdirplus as a batch replacement for lookup/getattr. -- v2: Remove reset of dtsize when NFS_INO_FORCE_READDIR is set v3: Avoid excessive window shrinking in uncached_readdir case v4: Track 'ls -l' cache hit/miss statistics Improved algorithm for falling back to uncached readdir Skip readdirplus when files are being written to v5: bugfixes Skip readdirplus when the acdirmax/acregmax values are low Request a full XDR buffer when doing READDIRPLUS v6: Add tracing Don't have lookup request readdirplus when it won't help Trond Myklebust (13): NFS: constify nfs_server_capable() and nfs_have_writebacks() NFS: Trace lookup revalidation failure NFS: Adjust the amount of readahead performed by NFS readdir NFS: Simplify nfs_readdir_xdr_to_array() NFS: Improve algorithm for falling back to uncached readdir NFS: Improve heuristic for readdirplus NFS: Don't ask for readdirplus unless it can help nfs_getattr() NFSv4: Ask for a full XDR buffer of readdir goodness NFS: Readdirplus can't help lookup for case insensitive filesystems NFS: Don't request readdirplus when revaldation was forced NFS: Add basic readdir tracing NFS: Trace effects of readdirplus on the dcache NFS: Trace effects of the readdirplus heuristic fs/nfs/dir.c | 275 +++++++++++++++++++++++++++-------------- fs/nfs/inode.c | 37 +++--- fs/nfs/internal.h | 4 +- fs/nfs/nfs3xdr.c | 7 +- fs/nfs/nfs4xdr.c | 6 +- fs/nfs/nfstrace.h | 122 +++++++++++++++++- include/linux/nfs_fs.h | 14 ++- 7 files changed, 339 insertions(+), 126 deletions(-) -- 2.35.1