Re: [PATCH 1/1] mm/hugetlb: keep max_huge_pages when dissolving surplus folios

Muchun Song <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.kernel.mm
Message-ID <[email protected]>

> On Aug 14, 2026, at 16:30, Longlong Xia <[email protected]> wrote:
> 
> From: Longlong Xia <[email protected]>
> 
> dissolve_free_hugetlb_folio() can remove a free folio as surplus when
> its node has surplus pages.  In that case remove_hugetlb_folio()
> decrements both nr_huge_pages and surplus_huge_pages, leaving the
> persistent pool size unchanged.
> 
> Updating max_huge_pages as if a persistent folio had been removed can
> therefore corrupt the persistent pool target and underflow it when
> max_huge_pages is zero.  Keep max_huge_pages unchanged for surplus
> folios, including the vmemmap restoration rollback path.
> 
> Fixes: cb402bbdabca ("mm/hugetlb: fix surplus pages in dissolve_free_huge_page()")
> Assisted-by: Codex:gpt-5.6-sol
> Signed-off-by: Longlong Xia <[email protected]>

Reviewed-by: Muchun Song <[email protected]>

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.