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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C556C0015E for ; Tue, 15 Aug 2023 19:58:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B08BC94002D; Tue, 15 Aug 2023 15:58:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AB8BE8D0001; Tue, 15 Aug 2023 15:58:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9826D94002D; Tue, 15 Aug 2023 15:58:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8A89A8D0001 for ; Tue, 15 Aug 2023 15:58:34 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4179C1C96EE for ; Tue, 15 Aug 2023 19:58:34 +0000 (UTC) X-FDA: 81127401348.11.74F80A1 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id 81DC4140007 for ; Tue, 15 Aug 2023 19:58:31 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=r2OD9Rs4; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692129512; a=rsa-sha256; cv=none; b=J085qDPD3qRV18A8SwxOazm1zs6l3Yhr9lTs5nRzzlTTOk1uvmROzBXFp5aPHjw3GESiDk IKPWAinPrTZKzAdyEIDrC8nD7/7pfyhG5bf/12PcaqzFs699UPNB7GwTclZYnZqT5zQoUA PVypOhT/PsDCXpt6ryj1VRILpuze2As= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=r2OD9Rs4; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692129512; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=REO/NuxNjKd1RI6P6mRiynN2pl2P7FWcjgXGh2Ezuqk=; b=ZgynAGJ0JPULLsHP7h2HyHKAEckMR+AC8yMv3W+1Lue2Jee5XZIXsSFPNywkrpre02z+O0 LbLc25FIMCW5jrn9a7br7hcFKL2XS3I6QkWsolhVNxqwa/5TKatp1kmysl3vWqY58I3vkT /0Sk/37DaFAkiCUUCir71uBzrRpNsjU= 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=REO/NuxNjKd1RI6P6mRiynN2pl2P7FWcjgXGh2Ezuqk=; b=r2OD9Rs4DfxSbofmquM9xQUsLU 5jLFZbX8XLKxE0n4Thj5T6NQYMoh1a+8ibUhXkb4IUyRIslrKvVtvGhwmK7ux230+vjQ07eiBlP0A uJiSI6Grug9Ao7cWQnnTXHoFrNrQHMkP0HVOVEr7/ZK2NZqsCms/mcoq8J/awNrgHU1anSYhlvUNY pcu1FAsgVWY9pP6txL0H1tSoddx0ndrg7+/84OS5STTCXRBUu5bL94inP2NQwc+m//aP5MGEWKhpM 6fCU3mC4+KkHumnXQo//dmLHFlZyjfMJrBd0JT7hdQDr7ORPrBSIn1YQkbcKF4IFci7b5sKoD++y7 UUXvhxew==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qW0BM-00A7t8-9s; Tue, 15 Aug 2023 19:58:24 +0000 Date: Tue, 15 Aug 2023 20:58:24 +0100 From: Matthew Wilcox To: David Hildenbrand Cc: Andrew Morton , Jens Axboe , io-uring@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 7/9] mm: Add deferred_list page flag Message-ID: References: <20230815032645.1393700-1-willy@infradead.org> <20230815032645.1393700-8-willy@infradead.org> <7c1bb01d-620c-ca97-c4a2-2bb7c126c687@redhat.com> <88bdc3d2-56e4-4c09-77fe-74fb4c116893@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 81DC4140007 X-Stat-Signature: fcrj4koazgxepwsup8y48k15timdk7e8 X-Rspam-User: X-HE-Tag: 1692129511-580221 X-HE-Meta: U2FsdGVkX1/EkOsccC34YRi1uQsD6DQGiwTOg0RqyF7win5RzLKGF8daty322YFQys67hZ2IGoPPgYrb8xJWL8DFkNM3RXBqT4joDs9rZzUcBsM+giskPEp49P2asU2QdUAmbE7xFcw5TNI68N0t1cGOF7qr4YMPkVFCXXp6SC2FFN1KtqZXH4yfsm3PSRaKoASS8ArtD/zLES85hezhAHRplyGEAZeu5UrWCwn+z1onlxqF6wFpHKL9Do0/dmnZ2sRsdYnSrgXObzbIlHCeJGlfpCimHsJ6IJPyex1oXCyj3kFss3sutEHQtJMIKhfTdhIV4H+Jbkh3qF0TwT23QmTL4Kn5B4wkyypjP1YEyZhzfa6kj4IADfi3djiVMVDABpxJkx/4dB/naVfVEBC1tHLtFVlOxdPx19UnsgqaVQbF21O01JKflP20pIf66R74W+/4Wn9p753uZNOB7J+qP8BThLqtkWZIZqpWd+KkOGtjK11SU3jKZ6bZu2NcbJ74grOeAv2gKDgMa8ZgMblV73l57Dgbyvl/V89ncjoPP4sG4U8/XWfBt3nVel6vGV/fj9jez+EDQQ3cupGoXkVoB4jAHymg8yyGi0hCFD60RAbvs8TQLi185Ysi+bsjy74973liggkjcldTtNSvJGe7xnyfSCtI4WjcpV6CcW3UaQzG8O4998QT9/E3SkcMx/fKhcZKWrzgDbh/NT+lzvaFnGRA81AKFYnqGIy4qXLGJAX5fdxbgYBg6TC1IjPLDdo7+KuHF2K+cMQ5JITWz5eJnSpK5+g3oS9j1fjZ75AFY4maXrt6L9uYlPDJxkagUw82DBOwO387+OCILN2XvSJAjFwMu7WnqIrUByqWaV0IYqf7CnT6ERLltDT63nEe2hsDd14Dgxzw6fEwCak7pYeWzgJ/Cll+nfTgziPzMXzs8jmOv9qvzAjIYfCv/c65TDRZ2pyhEUT6++7vh8NaleL Z1vUUXDb 93pIB7R1sLXNE5G9PPxUAmYGurDFte3I6zvTKFlWBr+Jp0MCR1Fbt533iJ99GFXVkgm7Ko9pSn7Q0Vqg1A4x5HoilUkwxfGbcDjIJD7877lwEVfvDVTWOUtnTKkmMITWYyZYjDpb39gRQGcv3dOa+jsAcUfVIO8kAuR3tIcJHWwvdu233tS5/8o3mzA== 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 Tue, Aug 15, 2023 at 07:27:26PM +0200, David Hildenbrand wrote: > On 15.08.23 19:06, Matthew Wilcox wrote: > > Theree are a lot of counters called THP and TransHuge and other variants > > which are exposed to userspace, and the (user) assumption is that this counts > > PMD-sized folios. If you grep around for folio_test_pmd_mappable(), > > you'll find them. If we have folio_test_thp(), people will write: > > > > if (folio_test_thp(folio)) > > __mod_lruvec_state(lruvec, NR_SHMEM_THPS, nr); > > > > instead of using folio_test_pmd_mappable(). > > So if we *really* don't want to use THP to express that we have a page, then > let's see what these pages are: > * can be mapped to user space > * are transparent to most MM-related systemcalls by (un) mapping > them in system page size (PTEs) * Are managed on the LRU * Can be dirtied, written back > That we can split these pages (not PTE-map, but convert from large folio to > small folios) is one characteristic, but IMHO not the main one (and maybe > not even required at all!). It's the one which distinguishes them from, say, compound pages used for slab. Or used by device drivers. Or net pagepool, or vmalloc. There's a lot of compound allocations out there, and the only ones which need special treatment here are the ones which are splittable. > Maybe we can come up with a better term for "THP, but not necessarily > PMD-sized". > > "Large folio" is IMHO bad. A hugetlb page is a large folio and not all large > folios can be mapped to user space. > > "Transparent large folios" ? Better IMHO. I think this goes back to Johannes' point many months ago that we need separate names for some things. He wants to split anon & file memory apart (who gets to keep the name "folio" in the divorce? what do we name the type that encompasses both folios and the other one? or do they both get different names?) > > Perhaps the key difference between normal compound pages and file/anon > > compound pages is that the latter are splittable? So we can name all > > of this: > > > > folio_init_splittable() > > folio_test_splittable() > > folio_fini_splittable() > > > > Maybe that's still too close to an implementation detail, but it's at > > least talking about _a_ characteristic of the folio, even if it's not > > the _only_ characteristic of the folio. > > Maybe folio_init_transparent() ... avoiding the "huge" part of it. > > Very open for alternatives. As expressed in other context, we really should > figure this out soon. Yeah, I'm open to better naming too. At this point in the flow we're trying to distinguish between compound pages used for slab and compound pages used for anon/file, but that's not always going to be the case elsewhere.