From: Ma Wupeng Date: Fri, 29 Apr 2022 06:16:14 +0000 (-0700) Subject: mm/page_alloc.c: calc the right pfn if page size is not 4K X-Git-Tag: for-5.19/block-exec-2022-06-02~28^2~289 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=aa282a157bf8ff79bed9164dc5e0e99f0d9e9755;p=linux-2.6-block.git mm/page_alloc.c: calc the right pfn if page size is not 4K Previous 0x100000 is used to check the 4G limit in find_zone_movable_pfns_for_nodes(). This is right in x86 because the page size can only be 4K. But 16K and 64K are available in arm64. So replace it with PHYS_PFN(SZ_4G). Link: https://lkml.kernel.org/r/20220414101314.1250667-8-mawupeng1@huawei.com Signed-off-by: Ma Wupeng Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Acked-by: Ard Biesheuvel Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Andrew Morton --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d2588d6226e0..298c7691fb1d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7821,7 +7821,7 @@ static void __init find_zone_movable_pfns_for_nodes(void) usable_startpfn = memblock_region_memory_base_pfn(r); - if (usable_startpfn < 0x100000) { + if (usable_startpfn < PHYS_PFN(SZ_4G)) { mem_below_4gb_not_mirrored = true; continue; }