Commit 13081df5 authored by Tejun Heo's avatar Tejun Heo

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: default avatarTejun 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>
parent 7d36b7bc
...@@ -251,7 +251,7 @@ update_nodes_add(int node, unsigned long start, unsigned long end) ...@@ -251,7 +251,7 @@ update_nodes_add(int node, unsigned long start, unsigned long end)
void __init void __init
acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
{ {
struct bootnode *nd, oldnode; struct bootnode *nd;
unsigned long start, end; unsigned long start, end;
int node, pxm; int node, pxm;
int i; int i;
...@@ -289,8 +289,12 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) ...@@ -289,8 +289,12 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
bad_srat(); bad_srat();
return; return;
} }
printk(KERN_INFO "SRAT: Node %u PXM %u %lx-%lx\n", node, pxm,
start, end);
if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)) {
nd = &nodes[node]; nd = &nodes[node];
oldnode = *nd;
if (!node_test_and_set(node, nodes_parsed)) { if (!node_test_and_set(node, nodes_parsed)) {
nd->start = start; nd->start = start;
nd->end = end; nd->end = end;
...@@ -300,17 +304,8 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) ...@@ -300,17 +304,8 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
if (nd->end < end) if (nd->end < end)
nd->end = end; nd->end = end;
} }
} else
printk(KERN_INFO "SRAT: Node %u PXM %u %lx-%lx\n", node, pxm,
start, end);
if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) {
update_nodes_add(node, start, end); update_nodes_add(node, start, end);
/* restore nodes[node] */
*nd = oldnode;
if ((nd->start | nd->end) == 0)
node_clear(node, nodes_parsed);
}
node_memblk_range[num_node_memblks].start = start; node_memblk_range[num_node_memblks].start = start;
node_memblk_range[num_node_memblks].end = end; node_memblk_range[num_node_memblks].end = end;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment