linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: Matthew Brost <matthew.brost@intel.com>,
	intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Christian Koenig <christian.koenig@amd.com>,
	Huang Rui <ray.huang@amd.com>,
	Matthew Auld <matthew.auld@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	"Liam R. Howlett" <liam@infradead.org>,
	Nico Pache <npache@redhat.com>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
	Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
	Dave Airlie <airlied@redhat.com>,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH 1/3] mm/huge_memory: add folio_split_driver_managed()
Date: Tue, 28 Jul 2026 14:58:39 +0200	[thread overview]
Message-ID: <603ef1ec-bccc-4fe4-9523-e8b8a731be63@kernel.org> (raw)
In-Reply-To: <2FD2B991-09B3-40EE-8230-49BE3A239EEC@nvidia.com>

On 7/27/26 20:23, Zi Yan wrote:
> On 27 Jul 2026, at 13:33, David Hildenbrand (Arm) wrote:
> 
>> On 7/22/26 17:28, Zi Yan wrote:
>>>
>>> Strickly speaking, these vm_insert*() compound pages are not folios,
>>> since folios are supposed to be rmappable and they are either anonymous
>>> memory or file-backed memory. I am working on separating them from
>>> rmappable folios by replacing PG_private with PG_folio and marking all
>>> pages in a folio with PG_folio in page_rmappable_folio().
>>>
>>> Hopefully, we can find a better name, like refcounted_folio, later for
>>> these non-rmappable compound pages.
>>
>> They wouldn't really be folios, I guess. They would likely be a simple
>> "refcounted" memtype that allows for compound pages.
> 
> Yes, they are not folios. But “folio” was started to replace “compound page”
> and slowly becomes rmappable anon and file-backed. People outside MM still
> thinks “folio” == “compound page”.

Yes, it's a bit of a mess now.

> But once I manage to remove PG_private
> and get us PG_folio, page_folio() will return NULL for non-folio compound
> pages and we will need a new type for them, “refcounted_XXX”. We can decide
> XXX when I get there. :)

So far willy did not document a type that just has a refcount.

https://kernelnewbies.org/MatthewWilcox/Memdescs

Maybe "Managed memory" (struct mgdesc) could be the right thing for some memory
with a refcount.

The question is, if the use case at hand would even require a refcount, of if
frozen pages would be good enough.

> 
>>
>> But what is the conclusion here? It sounds like "folio_split_" is the entirely
>> wrong interface for these compound pages.
> 
> We probably would allow folio_split() to be used on compound pages now
> until we can make a clean distinction, e.g., using PG_folio, between them.
> 
> Yes, folio_split() and its helper functions are meant for rmappable anon and
> file-backed folios. But currently “folio” is de facto “compound page”, since
> for example prep_compound_head() initializes folio fields even if it is meant
> only for compound pages.

If we can stop more abuse right from the start, that would be nice.

We do have split_page() that splits a non-compound higher-order page. Maybe we
want a split_compound_page(), or allow for split_page() to accept compound pages.

Because splitting a folio is really something different than splitting just some
compound page (no mapping/pagecache/whatever involved).

-- 
Cheers,

David


  parent reply	other threads:[~2026-07-28 12:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22  4:42 [PATCH 1/3] mm/huge_memory: add folio_split_driver_managed() Matthew Brost
2026-07-22  4:42 ` [PATCH 2/3] drm/xe: select TRANSPARENT_HUGEPAGE Matthew Brost
2026-07-22  4:42 ` [PATCH 3/3] drm/ttm: allocate pool pages as compound (__GFP_COMP) Matthew Brost
2026-07-22 14:26 ` [PATCH 1/3] mm/huge_memory: add folio_split_driver_managed() Zi Yan
2026-07-22 15:28   ` Zi Yan
2026-07-27 17:33     ` David Hildenbrand (Arm)
2026-07-27 18:23       ` Zi Yan
2026-07-27 20:34         ` Matthew Brost
2026-07-28 12:58         ` David Hildenbrand (Arm) [this message]
2026-07-28 14:44           ` Lorenzo Stoakes (ARM)
2026-07-28 15:52             ` Zi Yan
2026-07-28 14:40 ` Lorenzo Stoakes (ARM)
2026-07-28 14:46   ` Lorenzo Stoakes (ARM)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=603ef1ec-bccc-4fe4-9523-e8b8a731be63@kernel.org \
    --to=david@kernel.org \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=christian.koenig@amd.com \
    --cc=dev.jain@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=mripard@kernel.org \
    --cc=npache@redhat.com \
    --cc=ray.huang@amd.com \
    --cc=ryan.roberts@arm.com \
    --cc=simona@ffwll.ch \
    --cc=tvrtko.ursulin@igalia.com \
    --cc=tzimmermann@suse.de \
    --cc=willy@infradead.org \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).