aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-02-16 06:13:06 -0500
committerTejun Heo <tj@kernel.org>2011-02-16 06:13:06 -0500
commit13081df5dd6eae1951a3c398fa17d3ed2037a78f (patch)
tree4819da277060fff69ea7bfa13154f4648b34d477
parent7d36b7bc9022f35f95cd85cdf441846298e8f9fb (diff)
x86-64, NUMA: Simplify hotplug node handling in acpi_numa_memory_affinity_init()
Hotplug node handling in acpi_numa_memory_affinity_init() was unnecessarily complicated with storing the original nodes[] entry and restoring it afterwards. Simplify it by not modifying the nodes[] entry for hotplug nodes from the beginning. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Brian Gerst <brgerst@gmail.com> Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Shaohui Zheng <shaohui.zheng@intel.com> Cc: David Rientjes <rientjes@google.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--arch/x86/mm/srat_64.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index 23498f8b09a2..988b0b70ff39 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -251,7 +251,7 @@ update_nodes_add(int node, unsigned long start, unsigned long end)
251void __init 251void __init
252acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) 252acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
253{ 253{
254 struct bootnode *nd, oldnode; 254 struct bootnode *nd;
255 unsigned long start, end; 255 unsigned long start, end;
256 int node, pxm; 256 int node, pxm;
257 int i; 257 int i;
@@ -289,28 +289,23 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
289 bad_srat(); 289 bad_srat();
290 return; 290 return;
291 } 291 }
292 nd = &nodes[node];
293 oldnode = *nd;
294 if (!node_test_and_set(node, nodes_parsed)) {
295 nd->start = start;
296 nd->end = end;
297 } else {
298 if (start < nd->start)
299 nd->start = start;
300 if (nd->end < end)
301 nd->end = end;
302 }
303 292
304 printk(KERN_INFO "SRAT: Node %u PXM %u %lx-%lx\n", node, pxm, 293 printk(KERN_INFO "SRAT: Node %u PXM %u %lx-%lx\n", node, pxm,
305 start, end); 294 start, end);
306 295
307 if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) { 296 if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)) {
297 nd = &nodes[node];
298 if (!node_test_and_set(node, nodes_parsed)) {
299 nd->start = start;
300 nd->end = end;
301 } else {
302 if (start < nd->start)
303 nd->start = start;
304 if (nd->end < end)
305 nd->end = end;
306 }
307 } else
308 update_nodes_add(node, start, end); 308 update_nodes_add(node, start, end);
309 /* restore nodes[node] */
310 *nd = oldnode;
311 if ((nd->start | nd->end) == 0)
312 node_clear(node, nodes_parsed);
313 }
314 309
315 node_memblk_range[num_node_memblks].start = start; 310 node_memblk_range[num_node_memblks].start = start;
316 node_memblk_range[num_node_memblks].end = end; 311 node_memblk_range[num_node_memblks].end = end;