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 72269C433FE for ; Mon, 20 Sep 2021 01:04:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46E9A60F56 for ; Mon, 20 Sep 2021 01:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231313AbhITBGT (ORCPT ); Sun, 19 Sep 2021 21:06:19 -0400 Received: from mail107.syd.optusnet.com.au ([211.29.132.53]:33268 "EHLO mail107.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229755AbhITBGS (ORCPT ); Sun, 19 Sep 2021 21:06:18 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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