Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1202505pxb; Fri, 13 Nov 2020 06:51:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7ytP6WWcyMUnkBBE9/F26SThYoUZHSiWm0DMgbRyb0cz7FYfcv8rUNqsexUD0kzxM2TdL X-Received: by 2002:aa7:d94c:: with SMTP id l12mr2857520eds.355.1605279111655; Fri, 13 Nov 2020 06:51:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605279111; cv=none; d=google.com; s=arc-20160816; b=C/zWgdWhKlh3wM850KRbki7GRiRN9Yj7abcyzqrGxGHNwGQ0aYXWljcCos/pemw0Lm nBNwiiHgOpfuvsoEADssAWp1WRkjDBBj/5MN9KNxvvKzmmkpJ9U7g7FfaA6Gghx7CqM9 CmPQfL2W+jeze652X8W2WEPtj9be+vo+NPcSVAF3WRWGX7pzpS5qOGWXj+94jdJLx0bm 874dKCb//1kXUhH4kiwDCi2ML/t/mCuCB4HQx5r99eSRO1sRBOTj0NP5R8ZQJyM04ti3 3nCfDyykYtcqbtd0ZKsgnC78RvSx9ZNF60hWzcm9c42b+KZCvlFHxuv+ymI2al+msSTb pEvQ== 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=fHUo8ksvLkUenWiO+Z3+oXBdqyaq1gC4Ub1AQFepY1k=; b=fXjJGnBgZc9rQxMQMOCynzqj/W5X9wwHwBDuHqp7QhXHXLMRZvfF5BLd6wmIU6+UfQ ExTeVsL1ldJczj3EU4OLyHgrrW/UQAPogikXyD0CQVye4j/67RR3N3umgFw0FaTpHJGV owYd/AvafJa/gW+iGKW8DNtLbJuLMnhxIYtcZbtgBCqSnUs1EV6b+3rwLvQUMoGjlhex FVRqDmLSLE1iJaZwhXRoKBQNqPi4qqJobYFt4I96SIz2ULDE+1s8KUGy7Fx8IDLCU5A1 G3iwAmwytsKdtXm90DTPiFHBVV0rshIg/CXu1Q+1PVo3yYO46ObxY6oPuZvi76GmyTeB HRWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=U9x4G4kA; 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 gr12si5855638ejb.88.2020.11.13.06.51.12; Fri, 13 Nov 2020 06:51:51 -0800 (PST) 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=U9x4G4kA; 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 S1726324AbgKMOux (ORCPT + 99 others); Fri, 13 Nov 2020 09:50:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726278AbgKMOuw (ORCPT ); Fri, 13 Nov 2020 09:50:52 -0500 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED18BC0613D1 for ; Fri, 13 Nov 2020 06:50:52 -0800 (PST) Received: by fieldses.org (Postfix, from userid 2815) id E4A89BC8; Fri, 13 Nov 2020 09:50:50 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org E4A89BC8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1605279050; bh=fHUo8ksvLkUenWiO+Z3+oXBdqyaq1gC4Ub1AQFepY1k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U9x4G4kAcHMVz5ItdkTSXGEmUl+jpSPOALANycA9Ff2suy0Z3M8JKHIWshpXtf9gS 1J6v9Cwkscx4KtEcJNyaVLw1M/bvsE4S1GNMEaWfi/HpHmP3+nNtsZ7G0hOYOJy23K ThbDwGlNJwhW2flKrLxh53w89RgG6Splios2xPqk= Date: Fri, 13 Nov 2020 09:50:50 -0500 From: bfields To: Daire Byrne Cc: Trond Myklebust , linux-cachefs , linux-nfs Subject: Re: Adventures in NFS re-exporting Message-ID: <20201113145050.GB1299@fieldses.org> References: <943482310.31162206.1599499860595.JavaMail.zimbra@dneg.com> <279389889.68934777.1603124383614.JavaMail.zimbra@dneg.com> <635679406.70384074.1603272832846.JavaMail.zimbra@dneg.com> <20201109160256.GB11144@fieldses.org> <1744768451.86186596.1605186084252.JavaMail.zimbra@dneg.com> <20201112135733.GA9243@fieldses.org> <444227972.86442677.1605206025305.JavaMail.zimbra@dneg.com> <20201112205524.GI9243@fieldses.org> <883314904.86570901.1605222357023.JavaMail.zimbra@dneg.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <883314904.86570901.1605222357023.JavaMail.zimbra@dneg.com> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Nov 12, 2020 at 11:05:57PM +0000, Daire Byrne wrote: > So, I can't lay claim to identifying the exact optimisation/hack that > improves the retention of the re-export server's client cache when > re-exporting an NFSv3 server (which is then read by many clients). We > were working with an engineer at the time who showed an interest in > our use case and after we supplied a reproducer he suggested modifying > the nfs/inode.c > > - if (!inode_eq_iversion_raw(inode, fattr->change_attr)) { > + if (inode_peek_iversion_raw(inode) < fattr->change_attr) > { > > His reasoning at the time was: > > "Fixes inode invalidation caused by read access. The least important > bit is ORed with 1 and causes the inode version to differ from the one > seen on the NFS share. This in turn causes unnecessary re-download > impacting the performance significantly. This fix makes it only > re-fetch file content if inode version seen on the server is newer > than the one on the client." > > But I've always been puzzled by why this only seems to be the case > when using knfsd to re-export the (NFSv3) client mount. Using multiple > processes on a standard client mount never causes any similar > re-validations. And this happens with a completely read-only share > which is why I started to think it has something to do with atimes as > that could perhaps still cause a "write" modification even when > read-only? Ah-hah! So, it's inode_query_iversion() that's modifying a nfs inode's i_version. That's a special thing that only nfsd would do. I think that's totally fixable, we'll just have to think a little about how.... --b.