Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp100585pxt; Thu, 5 Aug 2021 19:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU8UMoapZwVBHuUCEIyVPBiHApeJ+L2ViqJEIMYUmXBU+Nb0+5sLB/MCpZJUa7SvoBXDqO X-Received: by 2002:a05:6e02:1561:: with SMTP id k1mr417301ilu.25.1628216735211; Thu, 05 Aug 2021 19:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628216735; cv=none; d=google.com; s=arc-20160816; b=nEZSpJ5wfkw/H/3Ibc1zoo4nV04tM17S/4w96fSjWzHELOSrCoDZ7sAzoCdTHqVorM TnikUyGLYNIfoKHjFfi9fJi+EY5+raVOww4Pb+BYcmdD/2vFGUPJc9JNFSrgZ6HigGG9 zq6CZ0jLLg/ZnrCCOs2x9usDjWQhS6EJ5qJbKfa673ajKbKoRlhju2etOYprfP9R5xuO a0IT1KPn6RXoNvK4P62W3HOUitFnqa3oflRqVeQAssyOvM0OhDhbbSC2Jb+oUVsmjQ+h WlgdIJ8egLZHnI86c7qsyMVpuO7M2nmXlyJEaKjJiLQLfUkAOs3rCQ1fXkKRzFXFQU9Z huWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=H3DXaH0DYq/AU+2Gphrkn9Lwf3WnAckLZe9TrSof2hk=; b=st9IbFZqH2SIGdMHu638TvbebVZfWsXPRRZM+AZRzS2v9r6n/4DvD/lWoUinARPcfc t+x/LYNkwC0EtuMDphou/exrA+/jfaA0HhvAEUpf5LSQDfBZJlQMJT/vBXBsCV/lB5kO JSks7k8nOCsqDBPqqLAtHJwMIJU2LbXUsRSEvpjbSMQ0HIw2yb+hDjyb34oS8DIw3xR8 bbvnw17/5aa/HtkMIQzfgAuH5kj8bge5Wx8mRK9kwahIlg6FI/aWZb8aD9i5S3uQ9VKY NDuQcPzUwMRxHbpAMTo9RelRi35l4WBniphQmAjO6Pr4f0dPokDfDo6pGzgsneNOEB6L XJVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=abtQMLOo; 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 t16si7966540jaq.36.2021.08.05.19.25.12; Thu, 05 Aug 2021 19:25:34 -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=@infradead.org header.s=casper.20170209 header.b=abtQMLOo; 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 S242473AbhHEXsh (ORCPT + 99 others); Thu, 5 Aug 2021 19:48:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232947AbhHEXsg (ORCPT ); Thu, 5 Aug 2021 19:48:36 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8081C0613D5; Thu, 5 Aug 2021 16:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=H3DXaH0DYq/AU+2Gphrkn9Lwf3WnAckLZe9TrSof2hk=; b=abtQMLOoZXkVPjuUhEHDqRyq8B KaXEaoLL1BbXX3emsso4LunhdcKMhxkxFYrvD42OWevUVXBkxay+rvTGncsdtcRnfeBGk8FEEJ82g 7/1GwpkJ5N+N8oeYGnLfSHWILFgbWRZWolqBrSWognGRqvZRQXjAioMsIt7VqwR/5y0set0rb2Sl8 h9eiGCC6w7qRlR//cfZPoHad3zUxLgvZHKF63EjM+zKlK/T0Bdbw8efLJ0qrWM7BwE0fJDaDjccp8 JIHfTwF5MfItHb3bT+6SzPp1jD/VaVUH71EQLFXh7i5EzMqMKWZH/pY+tCRYFBtVdRh4Xsh6Krd+Y hXAscibg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBn5L-007d2p-Uz; Thu, 05 Aug 2021 23:47:39 +0000 Date: Fri, 6 Aug 2021 00:47:35 +0100 From: Matthew Wilcox To: David Howells Cc: Anna Schumaker , Trond Myklebust , Jeff Layton , Steve French , Dominique Martinet , Mike Marshall , Miklos Szeredi , Shyam Prasad N , Linus Torvalds , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, devel@lists.orangefs.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Canvassing for network filesystem write size vs page size Message-ID: References: <1017390.1628158757@warthog.procyon.org.uk> <1170464.1628168823@warthog.procyon.org.uk> <1186271.1628174281@warthog.procyon.org.uk> <1219713.1628181333@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1219713.1628181333@warthog.procyon.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Aug 05, 2021 at 05:35:33PM +0100, David Howells wrote: > With Willy's upcoming folio changes, from a filesystem point of view, we're > going to be looking at folios instead of pages, where: > > - a folio is a contiguous collection of pages; > > - each page in the folio might be standard PAGE_SIZE page (4K or 64K, say) or > a huge pages (say 2M each); This is not a great way to explain folios. If you're familiar with compound pages, a folio is a new type for either a base page or the head page of a compound page; nothing more and nothing less. If you're not familiar with compound pages, a folio contains 2^n contiguous pages. They are treated as a single unit. > - a folio has one dirty flag and one writeback flag that applies to all > constituent pages; > > - a complete folio currently is limited to PMD_SIZE or order 8, but could > theoretically go up to about 2GiB before various integer fields have to be > modified (not to mention the memory allocator). Filesystems should not make an assumption about this ... I suspect the optimum page size scales with I/O bandwidth; taking PCI bandwidth as a reasonable proxy, it's doubled five times in twenty years. > Willy is arguing that network filesystems should, except in certain very > special situations (eg. O_SYNC), only write whole folios (limited to EOF). I did also say that the write could be limited by, eg, a byte-range lease on the file. If the client doesn't have permission to write a byte range, then it doesn't need to write it back.