aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/topology.c
diff options
context:
space:
mode:
authorYasunori Goto <y-goto@jp.fujitsu.com>2006-06-27 05:53:38 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-27 20:32:36 -0400
commit0fc44159bfcb5b0afa178f9c3f50db23aebc76ff (patch)
treed87e47c0f5e6b2eff1d9113d3495d185924734d9 /arch/i386/kernel/topology.c
parent1f04bbd2d396a701c5af2e5b92bad896c2550c16 (diff)
[PATCH] Register sysfs file for hotplugged new node
When new node becomes enable by hot-add, new sysfs file must be created for new node. So, if new node is enabled by add_memory(), register_one_node() is called to create it. In addition, I386's arch_register_node() and a part of register_nodes() of powerpc are consolidated to register_one_node() as a generic_code(). This is tested by Tiger4(IPF) with node hot-plug emulation. Signed-off-by: Keiichiro Tokunaga <tokuanga.keiich@jp.fujitsu.com> Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/topology.c')
-rw-r--r--arch/i386/kernel/topology.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/i386/kernel/topology.c b/arch/i386/kernel/topology.c
index 296355292c7c..1eecc2e1bd4b 100644
--- a/arch/i386/kernel/topology.c
+++ b/arch/i386/kernel/topology.c
@@ -38,7 +38,7 @@ int arch_register_cpu(int num){
38#ifdef CONFIG_NUMA 38#ifdef CONFIG_NUMA
39 int node = cpu_to_node(num); 39 int node = cpu_to_node(num);
40 if (node_online(node)) 40 if (node_online(node))
41 parent = &node_devices[node].node; 41 parent = &node_devices[parent_node(node)];
42#endif /* CONFIG_NUMA */ 42#endif /* CONFIG_NUMA */
43 43
44 /* 44 /*
@@ -61,7 +61,7 @@ void arch_unregister_cpu(int num) {
61#ifdef CONFIG_NUMA 61#ifdef CONFIG_NUMA
62 int node = cpu_to_node(num); 62 int node = cpu_to_node(num);
63 if (node_online(node)) 63 if (node_online(node))
64 parent = &node_devices[node].node; 64 parent = &node_devices[parent_node(node)];
65#endif /* CONFIG_NUMA */ 65#endif /* CONFIG_NUMA */
66 66
67 return unregister_cpu(&cpu_devices[num].cpu, parent); 67 return unregister_cpu(&cpu_devices[num].cpu, parent);
@@ -74,16 +74,13 @@ EXPORT_SYMBOL(arch_unregister_cpu);
74 74
75#ifdef CONFIG_NUMA 75#ifdef CONFIG_NUMA
76#include <linux/mmzone.h> 76#include <linux/mmzone.h>
77#include <asm/node.h>
78
79struct i386_node node_devices[MAX_NUMNODES];
80 77
81static int __init topology_init(void) 78static int __init topology_init(void)
82{ 79{
83 int i; 80 int i;
84 81
85 for_each_online_node(i) 82 for_each_online_node(i)
86 arch_register_node(i); 83 register_one_node(i);
87 84
88 for_each_present_cpu(i) 85 for_each_present_cpu(i)
89 arch_register_cpu(i); 86 arch_register_cpu(i);