diff options
author | Frank van der Linden <fvdl@google.com> | 2024-04-30 18:14:37 +0200 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-05-07 19:37:01 +0200 |
commit | cc48be374b654e1533c40cd64ebc4e4b0a637317 (patch) | |
tree | 77b2c360eeec4f0e87e51d5f9c202ac9b52c6dc3 /mm/hugetlb.c | |
parent | dax/bus.c: use the right locking mode (read vs write) in size_show (diff) | |
download | linux-cc48be374b654e1533c40cd64ebc4e4b0a637317.tar.xz linux-cc48be374b654e1533c40cd64ebc4e4b0a637317.zip |
mm/hugetlb: align cma on allocation order, not demotion order
Align the CMA area for hugetlb gigantic pages to their size, not the size
that they can be demoted to. Otherwise there might be misaligned sections
at the start and end of the CMA area that will never be used for hugetlb
page allocations.
Link: https://lkml.kernel.org/r/20240430161437.2100295-1-fvdl@google.com
Fixes: a01f43901cfb ("hugetlb: be sure to free demoted CMA pages to CMA")
Signed-off-by: Frank van der Linden <fvdl@google.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index a7efb350f5d0..33d175add044 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -7800,7 +7800,7 @@ void __init hugetlb_cma_reserve(int order) * huge page demotion. */ res = cma_declare_contiguous_nid(0, size, 0, - PAGE_SIZE << HUGETLB_PAGE_ORDER, + PAGE_SIZE << order, HUGETLB_PAGE_ORDER, false, name, &hugetlb_cma[nid], nid); if (res) { |