[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20251125094446.c78c5139f00ad8e00e9bd5d9@linux-foundation.org>
Date: Tue, 25 Nov 2025 09:44:46 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: "David Hildenbrand (Red Hat)" <david@...nel.org>
Cc: Zi Yan <ziy@...dia.com>, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>, "Liam R. Howlett"
<Liam.Howlett@...cle.com>, Nico Pache <npache@...hat.com>, Ryan Roberts
<ryan.roberts@....com>, Dev Jain <dev.jain@....com>, Barry Song
<baohua@...nel.org>, Lance Yang <lance.yang@...ux.dev>, Miaohe Lin
<linmiaohe@...wei.com>, Naoya Horiguchi <nao.horiguchi@...il.com>, Wei Yang
<richard.weiyang@...il.com>, Balbir Singh <balbirs@...dia.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/4] mm/huge_memory: change folio_split_supported()
to folio_check_splittable()
On Tue, 25 Nov 2025 09:58:03 +0100 "David Hildenbrand (Red Hat)" <david@...nel.org> wrote:
> > + * Return: 0 - @folio can be split to @new_order, otherwise an error number is
> > + * returned.
> > + */
> > +int folio_check_splittable(struct folio *folio, unsigned int new_order,
> > + enum split_type split_type, bool warns)
> > {
> > + VM_WARN_ON_FOLIO(!folio_test_locked(folio), folio);
> > + /*
> > + * Folios that just got truncated cannot get split. Signal to the
> > + * caller that there was a race.
> > + *
> > + * TODO: this will also currently refuse shmem folios that are in the
> > + * swapcache.
> > + */
>
> Per the other discussion, should this even be:
>
> "this will also currently refuse folios without a mapping in the
> swapcache (shmem or to-be-anon folios)"
>
> IOW, to spell out that anon folios that were read into the swapcache but
> not mapped yet into page tables (where we set folio->mapping).
This?
--- a/mm/huge_memory.c~mm-huge_memory-change-folio_split_supported-to-folio_check_splittable-fix
+++ a/mm/huge_memory.c
@@ -3714,7 +3714,8 @@ int folio_check_splittable(struct folio
* caller that there was a race.
*
* TODO: this will also currently refuse shmem folios that are in the
- * swapcache.
+ * swapcache. Currently it will also refuse folios without a mapping
+ * in the swapcache (shmem or to-be-anon folios).
*/
if (!folio_test_anon(folio) && !folio->mapping)
return -EBUSY;
_
Powered by blists - more mailing lists