x86: more strict check when cpu hot-plugged
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 x86: more strict check when cpu hot-plugged
When cpu is hot-plugged, it needs to be registered to one proper node under NUMA enabled mode. The check condition is very important so the more strict check is necessary.
Signed-off-by Chen Gong <[email protected]>
--- arch/x86/include/asm/numa_64.h | 1 + arch/x86/kernel/acpi/boot.c | 8 +++++++- arch/x86/mm/numa_64.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-)
arch/x86/include/asm/numa_64.h +1 -0
@@ -31,6 +31,7 @@ extern void setup_node_bootmem(int nodeid, unsigned long start,*/ #define NODE_MIN_SIZE (4*1024*1024) +extern int __cpuinit find_near_online_node (int node);extern void __init init_cpu_to_node (void );extern void __cpuinit numa_set_node (int cpu,int node);extern void __cpuinit numa_clear_node (int cpu);
arch/x86/kernel/acpi/boot.c +7 -1
@@ -498,12 +498,18 @@ static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)int nid; nid =acpi_get_node (handle); -if (nid ==-1 || !node_online (nid)) +if (nid ==NUMA_NO_NODE || physid ==BAD_APICID )return ;#ifdef CONFIG_X86_64 +if (!node_online (nid)) + nid =find_near_online_node (nid); + apicid_to_node[physid] = nid;numa_set_node (cpu, nid);#else /* CONFIG_X86_32 */ +if (!node_online (nid)) +return ; + apicid_2_node[physid] = nid; cpu_to_node_map[cpu] = nid;#endif
arch/x86/mm/numa_64.c +1 -1
@@ -733,7 +733,7 @@ early_param("numa", numa_setup);#ifdef CONFIG_NUMA -static __init int find_near_online_node (int node) +int __cpuinit find_near_online_node (int node) {int n, val;int min_val =INT_MAX ;
Signature · 1 line
1.7.0.2.279.gf1ba1c