Re: [PATCH 1/1] mm/hugetlb: keep max_huge_pages when dissolving surplus folios
Muchun Song <[email protected]>
| Newsgroups | org.kvack.linux-mm,org.kernel.vger.linux-kernel |
|---|---|
| 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.