Skip to content

Commit 2e5809a

Browse files
mjkravetzctmarinas
authored andcommitted
arm64/hugetlb: fix CMA gigantic page order for non-4K PAGE_SIZE
For non-4K PAGE_SIZE configs, the largest gigantic huge page size is CONT_PMD_SHIFT order. On arm64 with 64K PAGE_SIZE, the gigantic page is 16G. Therefore, one should be able to specify 'hugetlb_cma=16G' on the kernel command line so that one gigantic page can be allocated from CMA. However, when adding such an option the following message is produced: hugetlb_cma: cma area should be at least 8796093022208 MiB This is because the calculation for non-4K gigantic page order is incorrect in the arm64 specific routine arm64_hugetlb_cma_reserve(). Fixes: abb7962 ("arm64/hugetlb: Reserve CMA areas for gigantic pages on 16K and 64K configs") Cc: <[email protected]> # 5.9.x Signed-off-by: Mike Kravetz <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 22b70e6 commit 2e5809a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/mm/hugetlbpage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void __init arm64_hugetlb_cma_reserve(void)
4343
#ifdef CONFIG_ARM64_4K_PAGES
4444
order = PUD_SHIFT - PAGE_SHIFT;
4545
#else
46-
order = CONT_PMD_SHIFT + PMD_SHIFT - PAGE_SHIFT;
46+
order = CONT_PMD_SHIFT - PAGE_SHIFT;
4747
#endif
4848
/*
4949
* HugeTLB CMA reservation is required for gigantic

0 commit comments

Comments
 (0)