Re: [PATCH v2 04/15] mm/hugetlb: account temporary folios separately

From: Andrew Morton

Date: Sun Nov 22 2026 - 15:10:25 EST


On Sun, 22 Nov 2026 19:44:35 +0100 "David Hildenbrand (Arm)" <david@xxxxxxxxxx> wrote:

> > In combination with
> >
> > mm/hugetlb: preserve persistent flags when returning folios to the pool
> >
> > This results in an issue during boot.
> >
> > I think the following is required:
> >
> > diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> > index bfc88d42ef0d..aa6ad8d93266 100644
> > --- a/mm/hugetlb.c
> > +++ b/mm/hugetlb.c
> > @@ -1804,8 +1804,8 @@ void free_huge_folio(struct folio *folio)
> > h->resv_huge_pages++;
> >
> > if (folio_test_hugetlb_temporary(folio)) {
> > - folio_clear_hugetlb_temporary(folio);
> > remove_hugetlb_folio(h, folio, false);
> > + folio_clear_hugetlb_temporary(folio);
> > spin_unlock_irqrestore(&hugetlb_lock, flags);
> > update_and_free_hugetlb_folio(h, folio, true);
> > } else if (h->surplus_huge_pages_node[nid] &&
> >
> > I'll test real quick whether that resolves CI issues ...
> >
>
> Yes, that makes it work. @Andrew, can you fix that up?

np.

From: "David Hildenbrand (Arm)" <david@xxxxxxxxxx>
Subject: mm-hugetlb-account-temporary-folios-separately-fix
Date: Sun, 22 Nov 2026 19:21:43 +0100

In combination with

mm/hugetlb: preserve persistent flags when returning folios to the pool

This results in an issue during boot.

This fix is required.

Link: https://patch.msgid.link/45997a78-95bd-4e50-b433-f64237f9ec1a@xxxxxxxxxx
Signed-off-by: "David Hildenbrand (Arm)" <david@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

mm/hugetlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/hugetlb.c~mm-hugetlb-account-temporary-folios-separately-fix
+++ a/mm/hugetlb.c
@@ -1792,8 +1792,8 @@ void free_huge_folio(struct folio *folio
h->resv_huge_pages++;

if (folio_test_hugetlb_temporary(folio)) {
- folio_clear_hugetlb_temporary(folio);
remove_hugetlb_folio(h, folio, false);
+ folio_clear_hugetlb_temporary(folio);
spin_unlock_irqrestore(&hugetlb_lock, flags);
update_and_free_hugetlb_folio(h, folio, true);
} else if (h->surplus_huge_pages_node[nid]) {
_