mm/hugetlb: align cma on allocation order, not demotion order
authorFrank van der Linden <fvdl@google.com>
Tue, 30 Apr 2024 16:14:37 +0000 (16:14 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 7 May 2024 17:37:01 +0000 (10:37 -0700)
commitcc48be374b654e1533c40cd64ebc4e4b0a637317
tree77b2c360eeec4f0e87e51d5f9c202ac9b52c6dc3
parent2acf04532d6d655d8c3b2ee4ddeb320107043086
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>
mm/hugetlb.c