From: Frank van der Linden Date: Tue, 18 Feb 2025 18:16:32 +0000 (+0000) Subject: mm, hugetlb: use cma_declare_contiguous_multi X-Git-Tag: next-20250224~159^2~71 X-Git-Url: https://gentwo.org/gitweb/?a=commitdiff_plain;h=598399bf33bcb4a25c02eace00896e76669ff649;p=linux%2F.git mm, hugetlb: use cma_declare_contiguous_multi hugetlb_cma is fine with using multiple CMA ranges, as long as it can get its gigantic pages allocated from them. So, use cma_declare_contiguous_multi to allow for multiple ranges, increasing the chances of getting what we want on systems with gaps in physical memory. Link: https://lkml.kernel.org/r/20250218181656.207178-5-fvdl@google.com Signed-off-by: Frank van der Linden Cc: Alexander Gordeev Cc: Andy Lutomirski Cc: Dan Carpenter Cc: Dave Hansen Cc: Heiko Carstens Cc: Joao Martins Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Muchun Song Cc: Oscar Salvador Cc: Peter Zijlstra Cc: Roman Gushchin (Cruise) Cc: Usama Arif Cc: Vasily Gorbik Cc: Yu Zhao Signed-off-by: Andrew Morton --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 811b29f77abf..70e1749c987c 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -7746,9 +7746,8 @@ void __init hugetlb_cma_reserve(int order) * may be returned to CMA allocator in the case of * huge page demotion. */ - res = cma_declare_contiguous_nid(0, size, 0, - PAGE_SIZE << order, - HUGETLB_PAGE_ORDER, false, name, + res = cma_declare_contiguous_multi(size, PAGE_SIZE << order, + HUGETLB_PAGE_ORDER, name, &hugetlb_cma[nid], nid); if (res) { pr_warn("hugetlb_cma: reservation failed: err %d, node %d",