mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
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: a01f43901c
("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>
This commit is contained in:
parent
2acf04532d
commit
cc48be374b
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user