Skip to content

Commit 1943fee

Browse files
committed
LoongArch: numa: Fix high_memory calculation
For 64bit kernel without HIGHMEM, high_memory is the virtual address of the highest physical address in the system. But __va(get_num_physpages() << PAGE_SHIFT) is not what we want for high_memory because there may be holes in the physical address space. On the other hand, max_low_pfn is calculated from memblock_end_of_DRAM(), which is exactly corresponding to the highest physical address, so use it for high_memory calculation. Cc: <[email protected]> Fixes: d4b6f15 ("LoongArch: Add Non-Uniform Memory Access (NUMA) support") Signed-off-by: Chong Qiao <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 6465e26 commit 1943fee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/loongarch/kernel/numa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ void __init paging_init(void)
436436

437437
void __init mem_init(void)
438438
{
439-
high_memory = (void *) __va(get_num_physpages() << PAGE_SHIFT);
439+
high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
440440
memblock_free_all();
441441
}
442442

0 commit comments

Comments
 (0)