提交 85cc5135 编写于 作者: R Ravikiran G Thirumalai 提交者: Linus Torvalds

[PATCH] x86_64 early numa init fix

The tests Alok carried out on Petr's box confirmed that cpu_to_node[BP] is
not setup early enough by numa_init_array due to the x86_64 changes in
2.6.14-rc*, and unfortunately set wrongly by the work around code in
numa_init_array().  cpu_to_node[0] gets set with 1 early and later gets set
properly to 0 during identify_cpu() when all cpus are brought up, but
confusing the numa slab in the process.

Here is a quick fix for this.  The right fix obviously is to have
cpu_to_node[bsp] setup early for numa_init_array().  The following patch
will fix the problem now, and the code can stay on even when
cpu_to_node{BP] gets fixed early correctly.

Thanks to Petr for access to his box.

Signed off by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: NAlok N Kataria <alokk@calsoftinc.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 e6a045a5
...@@ -167,15 +167,14 @@ void __init numa_init_array(void) ...@@ -167,15 +167,14 @@ void __init numa_init_array(void)
mapping. To avoid this fill in the mapping for all possible mapping. To avoid this fill in the mapping for all possible
CPUs, as the number of CPUs is not known yet. CPUs, as the number of CPUs is not known yet.
We round robin the existing nodes. */ We round robin the existing nodes. */
rr = 0; rr = first_node(node_online_map);
for (i = 0; i < NR_CPUS; i++) { for (i = 0; i < NR_CPUS; i++) {
if (cpu_to_node[i] != NUMA_NO_NODE) if (cpu_to_node[i] != NUMA_NO_NODE)
continue; continue;
cpu_to_node[i] = rr;
rr = next_node(rr, node_online_map); rr = next_node(rr, node_online_map);
if (rr == MAX_NUMNODES) if (rr == MAX_NUMNODES)
rr = first_node(node_online_map); rr = first_node(node_online_map);
cpu_to_node[i] = rr;
rr++;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册