Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp732897pxk; Thu, 1 Oct 2020 12:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIZ+Hi4L4bElN1JQhf8sawFXbyLrdJiBG/4UvL41zOhRHr0OlxPUMgF6veJNUzuUmRVwaY X-Received: by 2002:a17:907:444d:: with SMTP id on21mr9310394ejb.329.1601580392987; Thu, 01 Oct 2020 12:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601580392; cv=none; d=google.com; s=arc-20160816; b=bXkiyzLOhe7aF+RZESOk/3gg09xDEy2al8tvZfuB+psMth+04pIrkpBiSXvhP+JFGt 6AEQovMPccAo70dqTL9cytYW7eHcMSyug5aU2Vwkl8UcDsf2bihDpdfDX1saaCUY4r0c sy3w9HzmlMszUVL09yy6CNUDhppQmJwm7QFTJgftGnQ14pvN4w+dG+e19HYPLNoK+dCs If/+5M3+rcfytGxx+HkfNdI7YZrTduJ0IBIVGEeuSao48hD2qi+baM3MpEBMOLctfn3I Rp20hob7ZBfqjaAe+O2yKiL9yd6FtUBWmBBzmtVlRAGD7YwUBo4hv5lxdrAR6sUSvwYO 3Z5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=ltvXPcwR2LtwQlvGVIAU+/wSgDtYkdhW2Yz9vWNl9qg=; b=DUfEtbWP70PAU0K+YdHmcTeB+cBG3gY2HNIs92W9OR0IRGH1vtn7jGkYtygDCrA0/u DFGss7y7Psx9TRZi5zje9pKeR2XGlUSU5Mj9y/TKQSQeTDqNXBZKsR2fZ7WcnkjEoeor pwFs9GJM7WRJmp4YoN+QvSAPgx5JTz5nu7AgG8SI2bzYWDKHih/CFXNLlYZEAeG+jZgS Kp1wb5e5i835YQEpl2viGZ+TCNvM6TM/Bzn0PghuLI+OmGJQ2bAkU4EWs5vWOnY9u6g3 CIdpV5j1mSrYL5T0TQAJyowITOchi8HPN0S27eBpVhQpJ7qud4WZf0B+4YmVsb18UmtZ Ji+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=wT6NCwFc; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si3999592edx.293.2020.10.01.12.26.09; Thu, 01 Oct 2020 12:26:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=wT6NCwFc; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729993AbgJAT0D (ORCPT + 99 others); Thu, 1 Oct 2020 15:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729990AbgJAT0D (ORCPT ); Thu, 1 Oct 2020 15:26:03 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D397C0613D0 for ; Thu, 1 Oct 2020 12:26:03 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 94D9F6192; Thu, 1 Oct 2020 15:26:02 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 94D9F6192 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1601580362; bh=ltvXPcwR2LtwQlvGVIAU+/wSgDtYkdhW2Yz9vWNl9qg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wT6NCwFcDZrhhcL21aaopfj5zSZTWkA+bdISv+Y7FADO2AssZ0NYhlITENVnyodu4 neA161RsKMIkTX7myBgNkvJmvgC4IYl8Zdz1cVRAoNyU4yvjGoDpPxB2Hioe1hNIa8 Qx09ja5v/HfUjgauRi6McOM/wJW4MiM9TdxSwsas= Date: Thu, 1 Oct 2020 15:26:02 -0400 From: "bfields@fieldses.org" To: Trond Myklebust Cc: "jlayton@kernel.org" , "linux-cachefs@redhat.com" , "linux-nfs@vger.kernel.org" , "daire@dneg.com" Subject: Re: [Linux-cachefs] Adventures in NFS re-exporting Message-ID: <20201001192602.GF1496@fieldses.org> References: <943482310.31162206.1599499860595.JavaMail.zimbra@dneg.com> <1155061727.42788071.1600777874179.JavaMail.zimbra@dneg.com> <97eff1ee2886c14bcd7972b17330f18ceacdef78.camel@kernel.org> <20201001184118.GE1496@fieldses.org> <1424d45ba1d140bfcff4ae834c70b0a79daa6807.camel@hammerspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424d45ba1d140bfcff4ae834c70b0a79daa6807.camel@hammerspace.com> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Oct 01, 2020 at 07:24:42PM +0000, Trond Myklebust wrote: > On Thu, 2020-10-01 at 14:41 -0400, J. Bruce Fields wrote: > > On Wed, Sep 30, 2020 at 03:30:22PM -0400, Jeff Layton wrote: > > > On Tue, 2020-09-22 at 13:31 +0100, Daire Byrne wrote: > > > > This patch helps to avoid this when applied to the re-export > > > > server but there may be other places where this happens too. I > > > > accept that this patch is probably not the right/general way to > > > > do this, but it helps to highlight the issue when re-exporting > > > > and it works well for our use case: > > > > > > > > --- linux-5.5.0-1.el7.x86_64/fs/nfs/inode.c 2020-01-27 > > > > 00:23:03.000000000 +0000 > > > > +++ new/fs/nfs/inode.c 2020-02-13 16:32:09.013055074 +0000 > > > > @@ -1869,7 +1869,7 @@ > > > > > > > > /* More cache consistency checks */ > > > > if (fattr->valid & NFS_ATTR_FATTR_CHANGE) { > > > > - if (!inode_eq_iversion_raw(inode, fattr- > > > > >change_attr)) { > > > > + if (inode_peek_iversion_raw(inode) < fattr- > > > > >change_attr) { > > > > /* Could it be a race with writeback? */ > > > > if (!(have_writers || have_delegation)) { > > > > invalid |= NFS_INO_INVALID_DATA > > > > > > > > With this patch, the re-export server's NFS client attribute > > > > cache is maintained and used by all the clients that then mount > > > > it. When many hundreds of clients are all doing similar things at > > > > the same time, the re-export server's NFS client cache is > > > > invaluable in accelerating the lookups (getattrs). > > > > > > > > Perhaps a more correct approach would be to detect when it is > > > > knfsd that is accessing the client mount and change the cache > > > > consistency checks accordingly? > > > > > > Yeah, I don't think you can do this for the reasons Trond outlined. > > > > I'm not clear whether Trond thought that knfsd's behavior in the case > > it > > returns NFS4_CHANGE_TYPE_IS_MONOTONIC_INCR might be good enough to > > allow > > this or some other optimization. > > > > NFS4_CHANGE_TYPE_IS_MONOTONIC_INCR should normally be good enough to > allow the above optimisation, yes. I'm less sure about whether or not > we are correct in returning NFS4_CHANGE_TYPE_IS_MONOTONIC_INCR when in > fact we are adding the ctime and filesystem-specific change attribute, > but we could fix that too. Could you explain your concern? --b.