Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5695056pxb; Tue, 16 Feb 2021 05:26:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwA2Jt9Uqtu1gzoaxKK+YW1GLcpEUCwxKjAT51zOh144tmAxRmJtCuHZ5SbuqJuDacPfACJ X-Received: by 2002:a17:906:c1c1:: with SMTP id bw1mr20811200ejb.86.1613481972468; Tue, 16 Feb 2021 05:26:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613481972; cv=none; d=google.com; s=arc-20160816; b=pIYxRd6cRIwtma/yhCHE+z4n88io/WGfc6O5HTVNb5YrUmxc5W2oiAo8D2fABY4u2C 0Y9uHsTczCK27vt93h2hG4tfEa//GXxwwiFTdH2OjPgHDp33ZURvALyQp9wvpEku2eev H2q5oEz2GlY3PzU3Rurxhz6zEdSXxMLcjXqXVa5CPwoPWw82BTCF7J+/czZEjLmb+H69 9DSmjnmcct/Gp7OwmVv6B+SEiZfCNqzdweqp02utDVLK/GeF4ROs/4UI4AnNxBanx2vl aEkI0mjTOfoK2k8d1vptzdEDRzKWUxk0GelRsyxFiRE6GJSufVJR2H9DAePU6V1MkQGP baLw== 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=hgIp8cMPVwAuFQ5Q63EIotyWvfFSj1q5sKGA4WuuKGw=; b=svbtojfuJvaFfA0uaJhmkov0x6IjIfFJjmc+hlNkACMwPXnf1kKY86yMlz1CmndaGW XBBE645QDf39oCUntrEjICqkeexszdZX+i6Da1YdGuUhwbnvjgQGybNrSZQy899errRM VoAYgVjNvu6Qy6Sn7lyn/1lVAHhNsyjwcg1VqPCY34E7yo6qYhgovdP/TwNsssoWteI2 I1puV2WbArlhhroev40JtuHKtg1arYIxr7OgB9Ect9TLjoiuWdpoyQIXxpgOImm2XqNG HkdwAdUG497GGx6V7GU4Btr0W5W2CkmP9aljOoTxUYAAZIX4Myl1u3XAMmcqo1Bk0iQr HQmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ctbhiVSD; 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 h6si1953341edf.15.2021.02.16.05.25.32; Tue, 16 Feb 2021 05:26:12 -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=@infradead.org header.s=casper.20170209 header.b=ctbhiVSD; 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 S229787AbhBPNZ2 (ORCPT + 99 others); Tue, 16 Feb 2021 08:25:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbhBPNZ2 (ORCPT ); Tue, 16 Feb 2021 08:25:28 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82BF8C061574; Tue, 16 Feb 2021 05:24:47 -0800 (PST) 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=hgIp8cMPVwAuFQ5Q63EIotyWvfFSj1q5sKGA4WuuKGw=; b=ctbhiVSDQqbf2BoXqncvKXwa5V yyZuAi6Jd2FD+1ogrQXZd4B3GkugraUEBxghjXti1sjtmIMBZbtRojFeQVOLvcSCNN7KWI8zGjHRB aTbPwSH/89Xk8nb6cxXt7r/DpupCtu6PRowMHNCggqKOsYqrSAKydaABwFJxd50yJQZnTj8UdGVoW V0fYtHecjoaTww/OoSZkKEThNGDBmEEDfNhjuoQuWlthj7jZ2lk6XmekUKGID08dGYnEgvpmu1c/k v7MMetTzabs77GeK+SjHzRTKERB2iiyjh2pOZt5/wPCbJ4YKul+uZv2isOLBi843nry0+UN0Q914n 9/DbbT1w==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lC0JX-00Gtih-RC; Tue, 16 Feb 2021 13:22:58 +0000 Date: Tue, 16 Feb 2021 13:22:51 +0000 From: Matthew Wilcox To: Christoph Hellwig Cc: David Howells , Trond Myklebust , Anna Schumaker , Steve French , Dominique Martinet , Alexander Viro , linux-mm@kvack.org, 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, linux-fsdevel@vger.kernel.org, Jeff Layton , David Wysochanski , linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/33] mm: Implement readahead_control pageset expansion Message-ID: <20210216132251.GI2858050@casper.infradead.org> References: <161340385320.1303470.2392622971006879777.stgit@warthog.procyon.org.uk> <161340389201.1303470.14353807284546854878.stgit@warthog.procyon.org.uk> <20210216103215.GB27714@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210216103215.GB27714@lst.de> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Feb 16, 2021 at 11:32:15AM +0100, Christoph Hellwig wrote: > On Mon, Feb 15, 2021 at 03:44:52PM +0000, David Howells wrote: > > Provide a function, readahead_expand(), that expands the set of pages > > specified by a readahead_control object to encompass a revised area with a > > proposed size and length. > > > > The proposed area must include all of the old area and may be expanded yet > > more by this function so that the edges align on (transparent huge) page > > boundaries as allocated. > > > > The expansion will be cut short if a page already exists in either of the > > areas being expanded into. Note that any expansion made in such a case is > > not rolled back. > > > > This will be used by fscache so that reads can be expanded to cache granule > > boundaries, thereby allowing whole granules to be stored in the cache, but > > there are other potential users also. > > So looking at linux-next this seems to have a user, but that user is > dead wood given that nothing implements ->expand_readahead. > > Looking at the code structure I think netfs_readahead and > netfs_rreq_expand is a complete mess and needs to be turned upside > down, that is instead of calling back from netfs_readahead to the > calling file system, split it into a few helpers called by the > caller. That's funny, we modelled it after iomap. > But even after this can't we just expose the cache granule boundary > to the VM so that the read-ahead request gets setup correctly from > the very beginning? The intent is that this be usable by filesystems which want to (for example) compress variable sized blocks. So they won't know which pages they want to readahead until they're in their iomap actor routine, see that the extent they're in is compressed, and find out how large the extent is.