From patchwork Wed Feb 9 18:42:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12740786 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AA0DC433EF for ; Wed, 9 Feb 2022 18:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240898AbiBISyY (ORCPT ); Wed, 9 Feb 2022 13:54:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241186AbiBISyI (ORCPT ); Wed, 9 Feb 2022 13:54:08 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C62DC1038D2 for ; Wed, 9 Feb 2022 10:49:41 -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 ams.source.kernel.org (Postfix) with ESMTPS id C9110B82385 for ; Wed, 9 Feb 2022 18:49:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FCC8C340F1 for ; Wed, 9 Feb 2022 18:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644432578; bh=l1cJW970K7Bm+hlEhwk5/9VkO6UwIAWTDsCdKUxx6pM=; h=From:To:Subject:Date:From; b=hyJbV9W4/Fom5je4G11Bxdi6An40AESsIwbgGulIN0OwT62VusWa5gCKzhM+b0++i xj+jU6WPTpMrz9bU3QK+x5rpi9r9/TMI2tA6Y0865xycCGOBAQQ3X7nS+taiLD3glV 5HlR0OPubBoRsZ3XjqmXg3xVujxJcCCB4Vx4KtWYFB8zDswwDKkYXPFllrx13+qGVv CT/DBav1dO3iC9CUBG71Rv9dODFmTwhfef8lTGlgeTratfu6BaCrIv9DH+i5KdVml9 SAYjCszy3ook98IAUesVZxRWk5TAAydMs5k+JLHyfPYuxleM/hh3pxGnIaTCtc2UAd ssA+Q3CW5SB2w== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH v3 0/2] Adaptive readdir readahead Date: Wed, 9 Feb 2022 13:42:49 -0500 Message-Id: <20220209184251.23909-1-trondmy@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 Trond Myklebust (2): NFS: Adjust the amount of readahead performed by NFS readdir NFS: Simplify nfs_readdir_xdr_to_array() fs/nfs/dir.c | 82 ++++++++++++++++++++++++++++++++---------- include/linux/nfs_fs.h | 1 + 2 files changed, 65 insertions(+), 18 deletions(-)