LoongArch: Introduce the numa_memblks conversion
authorHuacai Chen <chenhuacai@loongson.cn>
Fri, 30 May 2025 13:45:43 +0000 (21:45 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Fri, 30 May 2025 13:45:43 +0000 (21:45 +0800)
commita24f2fb70cb62180486ad4d74f809ff35ddd1cf9
tree9fbb82ee4b4dec7d5d93bc79202151eb5570ca28
parent9559d5806319a9254d9053b22a31324e1929aac6
LoongArch: Introduce the numa_memblks conversion

Commit 87482708210ff3333a ("mm: introduce numa_memblks") has moved
numa_memblks from x86 to the generic code, but LoongArch was left out
of this conversion.

This patch introduces the generic numa_memblks for LoongArch.

In detail:
1. Enable NUMA_MEMBLKS (but disable NUMA_EMU) in Kconfig;
2. Use generic definition for numa_memblk and numa_meminfo;
3. Use generic implementation for numa_add_memblk() and its friends;
4. Use generic implementation for numa_set_distance() and its friends;
5. Use generic implementation for memory_add_physaddr_to_nid() and its
   friends.

Note: Disable NUMA_EMU because it needs more efforts and no obvious
demand now.

Tested-by: Binbin Zhou <zhoubinbin@loongson.cn>
Signed-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/Kconfig
arch/loongarch/include/asm/numa.h
arch/loongarch/include/asm/sparsemem.h
arch/loongarch/include/asm/topology.h
arch/loongarch/kernel/acpi.c
arch/loongarch/kernel/numa.c
arch/loongarch/mm/init.c
mm/Kconfig