Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp813602pxb; Thu, 17 Feb 2022 15:35:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfrddpzIke5ruqWYx65kzzoCb1b0eGckCCFWZ8orH68SaIZWScXs0OKbsY4c39A/oo2xwi X-Received: by 2002:a17:903:28e:b0:14e:e1cf:fa03 with SMTP id j14-20020a170903028e00b0014ee1cffa03mr4958504plr.7.1645140944309; Thu, 17 Feb 2022 15:35:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645140944; cv=none; d=google.com; s=arc-20160816; b=T9TvS4XjOGsa3Mfe+FL6ElR/I/QG78iwrndWcjGpFcaoF5v5hoqmKlsRDYnlLykDG3 Vli9NrUkfmqQPNrxxNd34TR/FGJ7s3I1xR4OQNYSYz2GZu73j59921fP4RynhcBsJghU 0/MjfYcwM0EP0kME/1KH+0btYag5fsMxx6rk4Z/UhSZTB+Atctn6hyiPhkYOk2JMCIvP XQ4esy4BjN2Gx2sPfDhszajWIt8frPqDKDb/XIlQ0TlecWdHqIvhGuyQWQIsDes7tI52 UNMozLaBu/1O214me9pMAGXC19RCl8t5X5yUaLCQ43opxzRHGHFRaSJDxPWMtLC36Jar BZ8g== 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=Iz+jiIOf/RaGK3Qbgfb+fS47qTazTPUxWr11VYG3E54=; b=xu1JP9Um7xGy9QwysFfSMa2oYiwDHmKv/2WLHrSncuISnuwSWEgZ0t6Fo0czUVD2s1 SwE4xYOCOcNHN5WQEMS9Vh2oMQjbDGDO3WkTDWbgTf8OFr05ErgUra+HkZOzX9XQgj8H MjnMkwQANBh2zi+5Rn8eCAskWfcMtaiPgH+PRnR1xuHDM14HzzORau3a5Cm0eRVOCSLO ELz/7I/Cf8Sq50+q5c3eMLrU+wo0wSUxLT6an5sMYlHBovLy5A+P1Ztv2yNhNRtolUQR 2470yvclgKdyGk7v/yvLY3Ht6qWqBU7uD0x341uE3j2Ije/4p+2zu8B6BaLwYEXkUkXU TLdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vOCTu626; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 2si1959981pjx.94.2022.02.17.15.35.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 15:35:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vOCTu626; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 45FD22E71A4; Thu, 17 Feb 2022 15:16:14 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238033AbiBQWjs (ORCPT + 99 others); Thu, 17 Feb 2022 17:39:48 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343922AbiBQWjr (ORCPT ); Thu, 17 Feb 2022 17:39:47 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7651169223 for ; Thu, 17 Feb 2022 14:39:32 -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 sin.source.kernel.org (Postfix) with ESMTPS id 231FCCE30B7 for ; Thu, 17 Feb 2022 22:39:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C9DCC340E8 for ; Thu, 17 Feb 2022 22:39:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645137569; bh=tluS2rb1XiGRzaXLn7227m0+fFMcuHkbuh+VTqqGE68=; h=From:To:Subject:Date:From; b=vOCTu626yGkBwCTsiHEKEAS2pxq80NoaTQdFz5I59zk9f+PfARjET3Hcg9M9oPt/s eMKEL86ZVyywKgBE0y3j3FTu7TUZF9pBdXlnuxps8D3HLua+8TR0KBFul9r+wG1Wtd xkblOwFQWl3CX2ICdrewFgmvK+5LW0L+UmCsnH/GHBgffChJgpo/uN8uZB9nELDjo8 xZNGqYm8X6iDaO49Z/sma3h7fiAydUF6KS9WaImnjCN2wBBI7oB0KTmfbRfeRgUBkD fPLeLgF/Nvxq0blNA8ZX5uNihvj9GncaWr3m/G63hBoPNUEyOyAZoZB0W9T0MVIAjr c+TGUCPeRPaaQ== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH v4 0/5] Readdir improvements Date: Thu, 17 Feb 2022 17:33:18 -0500 Message-Id: <20220217223323.696173-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=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Trond Myklebust (5): 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 if files are being written to fs/nfs/dir.c | 210 ++++++++++++++++++++++++++--------------- fs/nfs/inode.c | 17 ++-- fs/nfs/internal.h | 4 +- fs/nfs/nfstrace.h | 1 - include/linux/nfs_fs.h | 7 +- 5 files changed, 153 insertions(+), 86 deletions(-) -- 2.35.1