Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1095304pxp; Wed, 9 Mar 2022 21:09:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8IZWL5HUuC94SuhLDub1nIhMD/Z8ScHFidxF++byS9E3YxgUYiQrmnGPoxc+wKPoRKCoD X-Received: by 2002:a05:6402:4414:b0:408:4dc0:3ee9 with SMTP id y20-20020a056402441400b004084dc03ee9mr2543794eda.203.1646888967110; Wed, 09 Mar 2022 21:09:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646888967; cv=none; d=google.com; s=arc-20160816; b=F8jf1lB1HERLiYQ9VdpTNtAT4TH3z0HwhUqMgqqfslCxi48p/dQK286Hraunpo9oKi nq3O5HnM7kGa7wQXollh2v1zFCjOllfjBf615Cd7arWRASiSWfkrckUlleVeWiCAZzH8 ZBm0+kwik/Hq6cfBXw4sD9Fti5bJgyrzWXS5ZcfuERnJyh86fm8N/XHEu4TuToabrDee r9Cx0nmtM/t8LpqNd/UAJpnN6s2qEDG1pwM3CqsYPve1x1rLuI496aV9+hT9niyWt09S kxFpEYHX3nNMsXeGeDE3wTJ3Emjq8s3+9gW9ZZja+/bQ/A7AUKxSpnTiJNBZD5nLh5ul RX/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qBOlenYCvFIb4MeX0O1Y4pISWifeC2EFuZ988voTLdk=; b=E29ld7i+GfaMRTNJYkD1Lg/vuD7SbXK/9DlFMLL01MnN51pbfIuygQqDL93mRcaKkW DK0XnGhxIJGIl6Px0A75mzqpdW6s/lZ0XtY+U5vISgJDfexQ4fJTjAJBW4V7BvFKgxye LtitF8UK3WPvEWzL04MT5+gmPJEb51oT4bpzFI8rgd92aM4kP5urrV3Zj4Rec1zfRbPg Z2mmutByism4yCdaTfJHfF7UTzRsSz7q+iDyyqU1hoPygC0UrB3Sm2ePGe5qmX3o3JCF OmZ2pIZLTeMIeCDaEsPp1s+ujDe9ZAnFz2FDELimThIOwd2RsxsZrJeneK2HAH/LV2yK vBSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NVsPTlOY; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w9-20020a056402070900b0041288e4c9c7si2494601edx.425.2022.03.09.21.08.51; Wed, 09 Mar 2022 21:09:27 -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=@redhat.com header.s=mimecast20190719 header.b=NVsPTlOY; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237739AbiCIVdU (ORCPT + 99 others); Wed, 9 Mar 2022 16:33:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233029AbiCIVdT (ORCPT ); Wed, 9 Mar 2022 16:33:19 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4DB4211D79A for ; Wed, 9 Mar 2022 13:32:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646861539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qBOlenYCvFIb4MeX0O1Y4pISWifeC2EFuZ988voTLdk=; b=NVsPTlOYmJ3LNyQyKveQdb8zNdmwuHqMgkorymFhEzjLy71fck17BfR/gbBoIlkNh+mY/F QC0VchzAWQfXm7PYDQAqiwsuDQs4vQ+Hew0XvGWtNcXa6d8eKbG+1j0+xGHX0MJ5s8bpA4 OHD8/HFq84eFisxqYxbZUrgA/kAX9B0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-604-Pk8d25hwNTGRxbk0FbcpNQ-1; Wed, 09 Mar 2022 16:32:16 -0500 X-MC-Unique: Pk8d25hwNTGRxbk0FbcpNQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 291991800D50; Wed, 9 Mar 2022 21:32:15 +0000 (UTC) Received: from [172.16.176.1] (ovpn-64-2.rdu2.redhat.com [10.10.64.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3CAF99CC; Wed, 9 Mar 2022 21:32:14 +0000 (UTC) From: "Benjamin Coddington" To: trondmy@kernel.org Cc: linux-nfs@vger.kernel.org Subject: Re: [PATCH v9 00/27] Readdir improvements Date: Wed, 09 Mar 2022 16:32:13 -0500 Message-ID: <23255C00-57BD-49D5-B228-F4D2C0AFDB32@redhat.com> In-Reply-To: <20220227231227.9038-1-trondmy@kernel.org> References: <20220227231227.9038-1-trondmy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 On 27 Feb 2022, at 18:12, trondmy@kernel.org wrote: > 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. > > This series also implement Ben's page cache filter to ensure that we can > improve the ability to share cached data between processes that are > reading the same directory at the same time, and to avoid live-locks > when the directory is simultaneously changing. > > -- > 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 > v7: Implement Ben's page cache filter > Reduce the use of uncached readdir > Change indexing of the page cache to improve seekdir() performance. > v8: Reduce the page cache overhead by shrinking the cookie hashvalue size > Incorporate other feedback from Anna, Ben and Neil > Fix nfs2/3_decode_dirent return values > Fix the change attribute value set in nfs_readdir_page_get_next() > v9: Address bugs that were hit when testing with large directories > Misc cleanups Hi Trond, thanks for all this work! I went through these from your testing branch (612896ec5a4e) rather than the posting. If it pleases, these can all get marked with my Reviewed-by: Benjamin Coddington and/or Tested-by: Benjamin Coddington .. except for 25/27, which is missing from the testing branch. As I replied to 23/27, I don't understand how the page index hashing is going to help out the re-export seekdir case, I think it might make it worse, and I think its unnecessary extra complication. I did test extensively total directory listing correctness, and it appears to me that you are correct, we are not regressing. We're in a similar place as before. I think we can be even more correct with directory verifiers or post-op updates with GETATTR in the READDIR compound for very little cost, but I've already made those arguments a few weeks ago. Thanks again, Ben