linux-stable/arch/loongarch
Liam Ni ff6c3d81f2 NUMA: optimize detection of memory with no node id assigned by firmware
Sanity check that makes sure the nodes cover all memory loops over
numa_meminfo to count the pages that have node id assigned by the
firmware, then loops again over memblock.memory to find the total amount
of memory and in the end checks that the difference between the total
memory and memory that covered by nodes is less than some threshold. 
Worse, the loop over numa_meminfo calls __absent_pages_in_range() that
also partially traverses memblock.memory.

It's much simpler and more efficient to have a single traversal of
memblock.memory that verifies that amount of memory not covered by nodes
is less than a threshold.

Introduce memblock_validate_numa_coverage() that does exactly that and use
it instead of numa_meminfo_cover_memory().

Link: https://lkml.kernel.org/r/20231026020329.327329-1-zhiguangni01@gmail.com
Signed-off-by: Liam Ni <zhiguangni01@gmail.com>
Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Binbin Zhou <zhoubinbin@loongson.cn>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Feiyang Chen <chenfeiyang@loongson.cn>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: WANG Xuerui <kernel@xen0n.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-10 16:51:34 -08:00
..
boot loongarch: efi: enable generic EFI compressed boot 2022-09-20 09:50:31 +02:00
configs LoongArch: KVM: Enable kvm config and add the makefile 2023-10-02 10:01:29 +08:00
crypto crypto: loongarch/crc32 - remove redundant setting of alignmask to 0 2023-10-27 18:04:24 +08:00
include LoongArch: Add __percpu annotation for __percpu_read()/__percpu_write() 2023-11-21 15:03:25 +08:00
kernel NUMA: optimize detection of memory with no node id assigned by firmware 2023-12-10 16:51:34 -08:00
kvm LoongArch: KVM: Enable kvm config and add the makefile 2023-10-02 10:01:29 +08:00
lib LoongArch: Add KASAN (Kernel Address Sanitizer) support 2023-09-06 22:54:16 +08:00
mm LoongArch: Mark {dmw,tlb}_virt_to_page() exports as non-GPL 2023-11-21 15:03:25 +08:00
net LoongArch: BPF: Support signed mod instructions 2023-11-08 14:12:21 +08:00
pci LoongArch: Add FDT booting support from efi system table 2022-12-14 08:41:53 +08:00
power LoongArch: Export some arch-specific pm interfaces 2023-06-29 20:58:44 +08:00
vdso kbuild: unify vdso_install rules 2023-10-28 21:09:02 +09:00
Kbuild LoongArch: KVM: Enable kvm config and add the makefile 2023-10-02 10:01:29 +08:00
Kconfig LoongArch changes for v6.7 2023-11-12 10:58:08 -08:00
Kconfig.debug LoongArch: Add prologue unwinder support 2022-08-12 13:10:11 +08:00
Makefile LoongArch: Explicitly set -fdirect-access-external-data for vmlinux 2023-11-21 15:03:25 +08:00