Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64, numa: Change the numa init functions name to be generic

This is a preparatory patch for unifying numa implementation between
ARM64 & RISC-V. As the numa implementation will be moved to generic
code, rename the arm64 related functions to a generic one.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>

authored by

Atish Patra and committed by
Palmer Dabbelt
eb75541f 5a2308da

+27 -20
+2 -2
arch/arm64/include/asm/numa.h
··· 32 32 } 33 33 #endif 34 34 35 - void __init arm64_numa_init(void); 35 + void __init arch_numa_init(void); 36 36 int __init numa_add_memblk(int nodeid, u64 start, u64 end); 37 37 void __init numa_set_distance(int from, int to, int distance); 38 38 void __init numa_free_distance(void); ··· 46 46 static inline void numa_store_cpu_info(unsigned int cpu) { } 47 47 static inline void numa_add_cpu(unsigned int cpu) { } 48 48 static inline void numa_remove_cpu(unsigned int cpu) { } 49 - static inline void arm64_numa_init(void) { } 49 + static inline void arch_numa_init(void) { } 50 50 static inline void early_map_cpu_to_node(unsigned int cpu, int nid) { } 51 51 52 52 #endif /* CONFIG_NUMA */
-12
arch/arm64/kernel/acpi_numa.c
··· 118 118 node_set(node, numa_nodes_parsed); 119 119 } 120 120 121 - int __init arm64_acpi_numa_init(void) 122 - { 123 - int ret; 124 - 125 - ret = acpi_numa_init(); 126 - if (ret) { 127 - pr_info("Failed to initialise from firmware\n"); 128 - return ret; 129 - } 130 - 131 - return srat_disabled() ? -EINVAL : 0; 132 - }
+2 -2
arch/arm64/mm/init.c
··· 418 418 max_pfn = max_low_pfn = max; 419 419 min_low_pfn = min; 420 420 421 - arm64_numa_init(); 421 + arch_numa_init(); 422 422 423 423 /* 424 - * must be done after arm64_numa_init() which calls numa_init() to 424 + * must be done after arch_numa_init() which calls numa_init() to 425 425 * initialize node_online_map that gets used in hugetlb_cma_reserve() 426 426 * while allocating required CMA size across online nodes. 427 427 */
+23 -4
arch/arm64/mm/numa.c
··· 13 13 #include <linux/module.h> 14 14 #include <linux/of.h> 15 15 16 - #include <asm/acpi.h> 17 16 #include <asm/sections.h> 18 17 19 18 struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; ··· 444 445 return 0; 445 446 } 446 447 448 + #ifdef CONFIG_ACPI_NUMA 449 + static int __init arch_acpi_numa_init(void) 450 + { 451 + int ret; 452 + 453 + ret = acpi_numa_init(); 454 + if (ret) { 455 + pr_info("Failed to initialise from firmware\n"); 456 + return ret; 457 + } 458 + 459 + return srat_disabled() ? -EINVAL : 0; 460 + } 461 + #else 462 + static int __init arch_acpi_numa_init(void) 463 + { 464 + return -EOPNOTSUPP; 465 + } 466 + #endif 467 + 447 468 /** 448 - * arm64_numa_init() - Initialize NUMA 469 + * arch_numa_init() - Initialize NUMA 449 470 * 450 471 * Try each configured NUMA initialization method until one succeeds. The 451 472 * last fallback is dummy single node config encompassing whole memory. 452 473 */ 453 - void __init arm64_numa_init(void) 474 + void __init arch_numa_init(void) 454 475 { 455 476 if (!numa_off) { 456 - if (!acpi_disabled && !numa_init(arm64_acpi_numa_init)) 477 + if (!acpi_disabled && !numa_init(arch_acpi_numa_init)) 457 478 return; 458 479 if (acpi_disabled && !numa_init(of_numa_init)) 459 480 return;