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

Gregory Price <[email protected]> Mon, 3 Aug 2026 10:49:01 -0400
Newsgroups org.kvack.linux-mm,org.kernel.vger.linux-kernel
Message-ID <anCqTkQsgOwy_0g4@gourry-fedora-PF4VCD3F>
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 <[email protected]>
> Acked-by: Oscar Salvador <[email protected]>
> Reviewed-by: Joshua Hahn <[email protected]>
> Signed-off-by: Ackerley Tng <[email protected]>

Reviewed-by: Gregory Price <[email protected]>