Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3167137pxb; Tue, 21 Sep 2021 16:32:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUDoBpc4+dhcLQ2A1vC12GUf5hNMqvNTTV6EFndk0Y6nk9g8MBkYMhxEjNPK3rOucvpHEd X-Received: by 2002:a05:6e02:12cc:: with SMTP id i12mr23653072ilm.273.1632267137180; Tue, 21 Sep 2021 16:32:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632267137; cv=none; d=google.com; s=arc-20160816; b=fc+jex3VDnwBOOOmctIrneDDLRZuF7yGPLcHVMKKUt0fPKFx3N9U58MNUhayPPZ241 zkVZzaGeSM6zBdzchEGuwCCigQwW5SHqzlCABkfl7OsHMAkLX2t1SZOFEWSKUpJybYbx Ny4F0me+DhXvy3E0plIsosFYwdz/PcfNaYWdr1Ra8sqiL80U4RzrN5qlkQu5+h1Yb2KW L/lKN0CyRW+tnmxqoFZNRaeF3J7qHwonSq2fTBkrucLs3j+Vn9a6tm7qWZaMRvGfhu0h wex2C1mRcv1oPGESo99dHsAIf50sHeqzfHDSLuOSlsQOSMweGpvVuyyCwhvQ383yv0IQ s0gg== 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=zCsTnszozcMWakwvCPgZXXhNyKNOkSlqncLZKwtc/cs=; b=stbfV7oWqzdDDJjSquENCAeonCvfgW2P8V0KYchb+U3qNEoe3dsh3LV7n6pM2G0qW2 RKciqHAvH2DWVq74lPxt3o5yFnwZTi+l3fV8VIKSqWpbcFd12O2sZV9wuY25aewTtyIt r+JY7RjhzUzCe3lOSi9tjj/WDTg9jtNjEqC6JQb61XtNKgZ6HO7ITaRKzmWtk3CvvBdW ix2MLVQ0zET/mm2hrNj/VLtBEv02aJtsbjhdNOuq167QJxAOSxXK6pZPEqgUTtnI5Sa2 Jbi4kYPSX3f/HBdidEfKtcGmsGmnlB+ukAGMJgzc6PUUUav0HBgQtjPu7yFC98KM7WE0 UuUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Wo0ChhyK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si588555iln.136.2021.09.21.16.32.04; Tue, 21 Sep 2021 16:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@gmail.com header.s=20210112 header.b=Wo0ChhyK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235287AbhIUVMu (ORCPT + 99 others); Tue, 21 Sep 2021 17:12:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235334AbhIUVMm (ORCPT ); Tue, 21 Sep 2021 17:12:42 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57F57C061574; Tue, 21 Sep 2021 14:11:13 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id c7so2278631qka.2; Tue, 21 Sep 2021 14:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zCsTnszozcMWakwvCPgZXXhNyKNOkSlqncLZKwtc/cs=; b=Wo0ChhyKDc641UkRQXImePyH7Kca90qJ0M+wVAZehOGrSvyqhqySnh5pwDSXOk0Sid 099qlb+GgA+Md5pIc2x9t8aAAXPPYV8seX2/g14ugartmaCaY7UuYkfBBQU0ISzOBTeT dwKLp1d9X5/q+QaLSRww/e1Q0VptwWRZjKF4D76F4dl7Myuxa5yrPy063I0Go8wsdgjg 75FZY2e3HkRR10Ma9X5+jUyJSe1jfC4N9Jlam2kripRtLC+/ltKOmAqvRfUekbMu4wWS w+WvRBaMCqN/MVo0MNiKpmYeBv43z859ecs5sj1JGolhDF/e8XTKR5nCe9HnEVy3FFhz JWeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zCsTnszozcMWakwvCPgZXXhNyKNOkSlqncLZKwtc/cs=; b=nj7mqf+7MITyBP7yJ1R7cCgFp0xG2368riFcDtnU1Ic5hRS51+8L9pMsTGBrwARvEr /NflbTLwQKqoL8QWZfLHGADYuk2IZn7qoxtatitintkLYD25g3ZR3XOhr2/2XYAt9Msj NRYrC2BxXyQrQXQRhDOkGAuSqzawYTo8XLjHdLswBp3f+ymIqwxBHy5qfSO3NCy29XvH 3mHSx/VrqU3feRLcVaPX4fW6rXIk+WsL6FwWXLBZNsvcYgp2FFvWAQ6zMJsXuxSRPXrI G5NNlQiUsaLVYZYRJcAnmYGrXeNs9Z2L0REFUortBbQf1CAKxjuRCHQnxHknUETAvmvg Je5Q== X-Gm-Message-State: AOAM5302ibAzP4q+AXNQdJ8dSdjgwkFiQyETvKKM0dcV6rQueJpsT//k xy6/xNbtciv3dGI6EF2KRw== X-Received: by 2002:ae9:efc9:: with SMTP id d192mr15818686qkg.366.1632258672543; Tue, 21 Sep 2021 14:11:12 -0700 (PDT) Received: from moria.home.lan (c-73-219-103-14.hsd1.vt.comcast.net. [73.219.103.14]) by smtp.gmail.com with ESMTPSA id m21sm131906qka.69.2021.09.21.14.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 14:11:11 -0700 (PDT) Date: Tue, 21 Sep 2021 17:11:09 -0400 From: Kent Overstreet To: Matthew Wilcox Cc: Johannes Weiner , Linus Torvalds , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , "Darrick J. Wong" , Christoph Hellwig , David Howells Subject: Re: Folio discussion recap Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 21, 2021 at 09:38:54PM +0100, Matthew Wilcox wrote: > On Tue, Sep 21, 2021 at 03:47:29PM -0400, Johannes Weiner wrote: > > and so the justification for replacing page with folio *below* those > > entry points to address tailpage confusion becomes nil: there is no > > confusion. Move the anon bits to anon_page and leave the shared bits > > in page. That's 912 lines of swap_state.c we could mostly leave alone. > > Your argument seems to be based on "minimising churn". Which is certainly > a goal that one could have, but I think in this case is actually harmful. > There are hundreds, maybe thousands, of functions throughout the kernel > (certainly throughout filesystems) which assume that a struct page is > PAGE_SIZE bytes. Yes, every single one of them is buggy to assume that, > but tracking them all down is a never-ending task as new ones will be > added as fast as they can be removed. Yet it's only file backed pages that are actually changing in behaviour right now - folios don't _have_ to be the tool to fix that elsewhere, for anon, for network pools, for slab. > > The anon_page->page relationship may look familiar too. It's a natural > > type hierarchy between superclass and subclasses that is common in > > object oriented languages: page has attributes and methods that are > > generic and shared; anon_page and file_page encode where their > > implementation differs. > > > > A type system like that would set us up for a lot of clarification and > > generalization of the MM code. For example it would immediately > > highlight when "generic" code is trying to access type-specific stuff > > that maybe it shouldn't, and thus help/force us refactor - something > > that a shared, flat folio type would not. > > If you want to try your hand at splitting out anon_folio from folio > later, be my guest. I've just finished splitting out 'slab' from page, > and I'll post it later. I don't think that splitting anon_folio from > folio is worth doing, but will not stand in your way. I do think that > splitting tail pages from non-tail pages is worthwhile, and that's what > this patchset does. Eesh, we can and should hold ourselves to a higher standard in our technical discussions. Let's not let past misfourtune (and yes, folios missing 5.15 _was_ unfortunate and shouldn't have happened) colour our perceptions and keep us from having productive working relationships going forward. The points Johannes is bringing up are valid and pertinent and deserve to be discussed. If you're still trying to sell folios as the be all, end all solution for anything using compound pages, I think you should be willing to make the argument that that really is the _right_ solution - not just that it was the one easiest for you to implement. Actual code might make this discussion more concrete and clearer. Could you post your slab conversion?