Skip to content

Commit

Permalink
x86: not set node to cpu_to_node if the node is not online
Browse files Browse the repository at this point in the history
resolve boot problem reported by Mel Gorman:

   http://lkml.org/lkml/2008/2/13/404

init_cpu_to_node will use cpu->apic (from MADT or mptable) and
apic->node(from SRAT or AMD config space with k8_bus_64.c) to have
cpu->node mapping, and later identify_cpu will overwrite them
again...(with nearby_node...)

this patch checks if the node is online, otherwise it will not
update cpu_node map. so keep cpu_node map to online node before
identify_cpu..., to prevent possible error.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Mar 4, 2008
1 parent 18a8622 commit 7c9e92b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/x86/mm/numa_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,13 +622,17 @@ void __init init_cpu_to_node(void)
int i;

for (i = 0; i < NR_CPUS; i++) {
int node;
u16 apicid = x86_cpu_to_apicid_init[i];

if (apicid == BAD_APICID)
continue;
if (apicid_to_node[apicid] == NUMA_NO_NODE)
node = apicid_to_node[apicid];
if (node == NUMA_NO_NODE)
continue;
numa_set_node(i, apicid_to_node[apicid]);
if (!node_online(node))
continue;
numa_set_node(i, node);
}
}

Expand Down

0 comments on commit 7c9e92b

Please sign in to comment.