From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16C79C433F5 for ; Mon, 20 Sep 2021 01:04:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6A8666101B for ; Mon, 20 Sep 2021 01:04:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6A8666101B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fromorbit.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 78308900003; Sun, 19 Sep 2021 21:04:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 73216900002; Sun, 19 Sep 2021 21:04:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64798900003; Sun, 19 Sep 2021 21:04:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id 53FF5900002 for ; Sun, 19 Sep 2021 21:04:53 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0E39228DA2 for ; Mon, 20 Sep 2021 01:04:53 +0000 (UTC) X-FDA: 78606157266.30.0E914D8 Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by imf11.hostedemail.com (Postfix) with ESMTP id 86A28F0000BF for ; Mon, 20 Sep 2021 01:04:52 +0000 (UTC) Received: from dread.disaster.area (pa49-195-238-16.pa.nsw.optusnet.com.au [49.195.238.16]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id AE8CB98D5; Mon, 20 Sep 2021 11:04:48 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1mS7jj-00ETf4-GT; Mon, 20 Sep 2021 11:04:47 +1000 Date: Mon, 20 Sep 2021 11:04:47 +1000 From: Dave Chinner To: Kent Overstreet Cc: Johannes Weiner , "Darrick J. Wong" , Matthew Wilcox , Linus Torvalds , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , Christoph Hellwig , David Howells Subject: Re: Folio discussion recap Message-ID: <20210920010447.GU2361455@dread.disaster.area> References: <20210916025854.GE34899@magnolia> <20210917052440.GJ1756565@dread.disaster.area> <20210918010440.GK1756565@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=Tu+Yewfh c=1 sm=1 tr=0 a=DzKKRZjfViQTE5W6EVc0VA==:117 a=DzKKRZjfViQTE5W6EVc0VA==:17 a=kj9zAlcOel0A:10 a=7QKq2e-ADPsA:10 a=7-415B0cAAAA:8 a=St-ALpV-QOArFpp15CwA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 86A28F0000BF X-Stat-Signature: jraep363fcy7d1k64znhgbnjns3zgkdu Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=none; spf=none (imf11.hostedemail.com: domain of david@fromorbit.com has no SPF policy when checking 211.29.132.53) smtp.mailfrom=david@fromorbit.com X-HE-Tag: 1632099892-665078 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Sep 18, 2021 at 12:51:50AM -0400, Kent Overstreet wrote: > On Sat, Sep 18, 2021 at 11:04:40AM +1000, Dave Chinner wrote: > > As for long term, everything in the page cache API needs to > > transition to byte offsets and byte counts instead of units of > > PAGE_SIZE and page->index. That's a more complex transition, but > > AFAIA that's part of the future work Willy is intended to do with > > folios and the folio API. Once we get away from accounting and > > tracking everything as units of struct page, all the public facing > > APIs that use those units can go away. > > Probably 95% of the places we use page->index and page->mapping aren't necessary > because we've already got that information from the context we're in and > removing them would be a useful cleanup *nod* > - if we've already got that from context > (e.g. we're looking up the page in the page cache, via i_pageS) eliminating the > page->index or page->mapping use means we're getting rid of a data dependency so > it's good for performance - but more importantly, those (much fewer) places in > the code where we actually _do_ need page->index and page->mapping are really > important places to be able to find because they're interesting boundaries > between different components in the VM. *nod* This is where infrastructure like like write_cache_pages() is problematic. It's not actually a component of the VM - it's core page cache/filesystem API functionality - but the implementation is determined by the fact there is no clear abstraction between the page cache and the VM and so while the filesysetm side of the API is byte-ranged based, the VM side is struct page based and so the impedence mismatch has to be handled in the page cache implementation. Folios are definitely pointing out issues like this whilst, IMO, demonstrating that an abstraction like folios are also a necessary first step to address the problems they make obvious... Cheers, Dave. -- Dave Chinner david@fromorbit.com