Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp4129587rdb; Wed, 30 Aug 2023 17:17:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHL3sEnUIi57LtKFidltRao/tuasqQJWZEBoikPa9+1NiC6fR4DwLj+XY0Geohyk7xPyJ7m X-Received: by 2002:a17:906:319a:b0:9a1:ec3d:9004 with SMTP id 26-20020a170906319a00b009a1ec3d9004mr3005396ejy.9.1693441070577; Wed, 30 Aug 2023 17:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693441070; cv=none; d=google.com; s=arc-20160816; b=digVQRc3HawVHV3Cp0looCAeChQmK7callCmy2lsA/VDhyre7ciDD+qZSgbBASwr4i SOVnpYn9wNsqh/qxqOrOARURlMyBHenf+qxyc73NhShp55xj7BHC6e1ODQ5gz5aoZ8ib R4YrTEacuo6kgSZi78XNZuAN8DH13YdCteQETn9+/po1M3XEnWFwWhHcua79Dt0vH85E 90zMkfAriy7sY4cHM1uiIPk9moj5q2E8f7OBiv6Hfis8fx9ZNH9MeY1HMQZmAXneALGA zhtbXW/7ZW6PmXSEn8G2dXlAJYZsRJtFeUsQt6/R3RrB28Be0E5g0lZKmnC9DL6MjCR/ HBUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=NWm+iqazdq6J0gVimozaTYaP8WzA44yR7XF7B/Lt9R4=; fh=LxcNfJvFGT7r6DoLcnbYib2ZVYLHQQOr7Wv0GFo0dTQ=; b=vU5PcQHVPx+Xjwk4gqg7Ci8EKrtMtdGDaLMi9yr80CHPeCjlS4wEKpDYYzI+c/brPZ gMB/uxzZYET+4CTQ0wO1aARMnVOS7QSiNoUsj4OfEtgVVS6oFXMs5m4De9xPenmC80/3 tUdGLwxiPbPsFSDUp3wo5LS55LLRSydn2Tlkk5Z1phVSrWAEjAF35YLFAUddyrcLWrj8 +wn4XsFcPZMpCvn8kt4RCTiOdpdJtd/KC6eTufqulXrn1PwMJRwx3Q0NoTiE6RO2qNF1 mJ2DKjLV1ZRNs9uuev74KiT4I4glDRIQfxYEhZtRZxUDmUmutaLyV1uPRBnDepkcQi7T CsoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MuC75K49; 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 e25-20020a170906375900b0099bd6900520si155773ejc.1000.2023.08.30.17.17.21; Wed, 30 Aug 2023 17:17:50 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MuC75K49; 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 S1343738AbjH3WVW (ORCPT + 99 others); Wed, 30 Aug 2023 18:21:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343774AbjH3WVL (ORCPT ); Wed, 30 Aug 2023 18:21:11 -0400 X-Greylist: delayed 3544 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 30 Aug 2023 15:20:47 PDT Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71234CEC for ; Wed, 30 Aug 2023 15:20:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3CDF7B81FB1 for ; Wed, 30 Aug 2023 21:14:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54FF7C433C9; Wed, 30 Aug 2023 21:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693430077; bh=NWm+iqazdq6J0gVimozaTYaP8WzA44yR7XF7B/Lt9R4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=MuC75K495bEoYbE01sFC/2AfmeBk64z/lPQ3bCIFsYd85XjUii+yAskXqpuAqDOEe C+46BCkUtXAOQhgbBQIIuGFe+TrextO7W40bJt/Cf+HK9QvDVNWb965G5Db4WwSWTt ogtEjhOfcKUqNBX9Cc13PqHT9dTlFoFelI/JTdRyb1mmfP/JtdxP1gTXd+gGCbgODN 5UjgneS5A7gRQGbAumnlNAKprjpt+4URMmea5hBFSNvLcDnUUOWtZ3+iSXCefFfqiH RAbT3D+54wP+I6lPDMuBI4Cu3nEsUCAZChcT/3Ka+qG2EO7k1IFz7z9O7rUS/F0NhQ DEhFIpTwV0D1A== Message-ID: Subject: Re: [PATCH v2] NFSv4: Always ask for type with READDIR From: Jeff Layton To: Trond Myklebust , "anna@kernel.org" , "bcodding@redhat.com" Cc: "linux-nfs@vger.kernel.org" Date: Wed, 30 Aug 2023 17:14:35 -0400 In-Reply-To: <4eb846815a1cdd1a98e064305b57a890b46e2708.camel@hammerspace.com> References: <82d1908e4f835a2f16a509a11b62b9d93ccb6cdf.1693424491.git.bcodding@redhat.com> <4eb846815a1cdd1a98e064305b57a890b46e2708.camel@hammerspace.com> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 On Wed, 2023-08-30 at 20:20 +0000, Trond Myklebust wrote: > On Wed, 2023-08-30 at 16:10 -0400, Jeff Layton wrote: > > On Wed, 2023-08-30 at 15:42 -0400, Benjamin Coddington wrote: > > > Again we have claimed regressions for walking a directory tree, > > > this time > > > with the "find" utility which always tries to optimize away asking > > > for any > > > attributes until it has a complete list of entries.=A0 This behavior > > > makes > > > the readdir plus heuristic do the wrong thing, which causes a storm > > > of > > > GETATTRs to determine each entry's type in order to continue the > > > walk. > > >=20 > > > For v4 add the type attribute to each READDIR request to include it > > > no > > > matter the heuristic.=A0 This allows a simple `find` command to > > > proceed > > > quickly through a directory tree. > > >=20 > >=20 > > The important bit here is that with v4, we can fill out d_type even > > when > > "plus" is false, at little cost. The downside is that non-plus > > READDIR > > replies will now be a bit larger on the wire. I think it's a > > worthwhile > > tradeoff though. >=20 > The reason why we never did it before is that for many servers, it > forces them to go to the inode in order to retrieve the information. >=20 > IOW: You might as well just do readdirplus. >=20 That makes total sense, given how this code has evolved. FWIW, the Linux NFS server already calls vfs_getattr for every dentry in a v4 READDIR reply regardless of what the client requests. It has to in order to detect junctions, so we're bringing in the inode no matter what. Fetching the type is trivial, so I don't see this as costing anything extra there. Mileage could vary on other servers with more synthetic filesystems, but one would hope that most of them can also return the type cheaply. --=20 Jeff Layton