Re: 2.6.24 git2/mm1: cpu_to_node mapping to non-existant nodes causing boot failure

From: Mel Gorman
Date: Mon Mar 03 2008 - 11:27:25 EST


On (28/02/08 09:45), Yinghai Lu didst pronounce:
> On Thu, Feb 28, 2008 at 7:42 AM, Mel Gorman <mel@xxxxxxxxx> wrote:
> > On (26/02/08 22:29), Yinghai Lu didst pronounce:
> >
> > > > >
> > > > > Did you get a chance to try out this patch to see if it cleared up the problem
> > > > > booting on your x86_64 numa box?
> > >
> > > did it fail with x86.git#testing?
> > >
> >
> > No, it boots successfully with that git branch. Somewhere in there is a fix.
> >
>
> can you verify which one fix that ?
>
> http://git.kernel.org/?p=linux/kernel/git/x86/linux-2.6-x86.git;a=commitdiff;h=a8de04ce4e4cf0af94aeb3829be8c9f813b2f5de

This one was the fix.

commit a8de04ce4e4cf0af94aeb3829be8c9f813b2f5de
Author: Yinghai Lu <Yinghai.Lu@xxxxxxx>
Date: Tue Feb 19 15:35:54 2008 -0800

x86_64: not set node to cpu_to_node if the node is not online

numa_init_array will set round-bin to all cpu to online nodes.
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 will check if the node is online, otherwise 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@xxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index f744c46..0c9b2bd 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -620,13 +620,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);
}
}

--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/