]> git.baikalelectronics.ru Git - kernel.git/commit
LoongArch: numa: Fix high_memory calculation
authorHuacai Chen <chenhuacai@loongson.cn>
Wed, 27 Sep 2023 08:19:13 +0000 (16:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2023 12:57:01 +0000 (14:57 +0200)
commit490f3b805ee3639e8b69c91d63e1ea76189950ae
tree9bfc43a52bbdbd791b041194465b7c89bf8333bf
parent7bc8585aa0719dd1996be804dd4fba601d48f3d6
LoongArch: numa: Fix high_memory calculation

commit 1943feecf80e73ecc03ce40271f29c6cea142bac upstream.

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: <stable@vger.kernel.org>
Fixes: d4b6f1562a3c3284adce ("LoongArch: Add Non-Uniform Memory Access (NUMA) support")
Signed-off-by: Chong Qiao <qiaochong@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/loongarch/kernel/numa.c