Commit 25b5e19d authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: Fix CMP with interleaving

Check if node exists during CMP setup and fall back to other node if needed.
This avoids a crash when the NUMA node discovery fails (e.g.  due to node
interleaving in the BIOS or numa=off)
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 08c3aca7
......@@ -727,6 +727,8 @@ static int __init init_amd(struct cpuinfo_x86 *c)
cpu = c->x86_apicid;
if (acpi_numa <= 0 && c->x86_num_cores > 1) {
cpu_to_node[cpu] = cpu >> hweight32(c->x86_num_cores - 1);
if (!node_online(cpu_to_node[cpu]))
cpu_to_node[cpu] = first_node(node_online_map);
}
printk(KERN_INFO "CPU %d(%d) -> Node %d\n",
cpu, c->x86_num_cores, cpu_to_node[cpu]);
......
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