Re: [PATCH v5 1/3] mm: hugetlb: Consolidate interpretation of gbl_chg within alloc_hugetlb_folio()

From: Gregory Price

Date: Mon Aug 03 2026 - 12:23:54 EST


On Mon, Aug 03, 2026 at 06:37:58AM -0700, Ackerley Tng wrote:
> The dequeue_hugetlb_folio_vma() function currently handles the gbl_chg
> parameter to determine if a folio can be dequeued based on global page
> availability. This leaks reservation-specific logic into the dequeueing
> path.
>
> Relocate this logic to alloc_hugetlb_folio() so that
> dequeue_hugetlb_folio_vma() focuses solely on selecting and dequeuing a
> folio. In alloc_hugetlb_folio(), only attempt to dequeue a folio if a
> reservation exists (gbl_chg == 0) or if there are available huge pages in
> the global pool.
>
> No functional change intended.
>
> Reviewed-by: James Houghton <jthoughton@xxxxxxxxxx>
> Acked-by: Oscar Salvador <osalvador@xxxxxxx>
> Reviewed-by: Joshua Hahn <joshua.hahnjy@xxxxxxxxx>
> Signed-off-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>

Reviewed-by: Gregory Price <gourry@xxxxxxxxxx>