Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[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: Alok N Kataria <alokk@calsoftinc.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Ravikiran G Thirumalai and committed by
Linus Torvalds
85cc5135 e6a045a5

+2 -3
+2 -3
arch/x86_64/mm/numa.c
··· 167 167 mapping. To avoid this fill in the mapping for all possible 168 168 CPUs, as the number of CPUs is not known yet. 169 169 We round robin the existing nodes. */ 170 - rr = 0; 170 + rr = first_node(node_online_map); 171 171 for (i = 0; i < NR_CPUS; i++) { 172 172 if (cpu_to_node[i] != NUMA_NO_NODE) 173 173 continue; 174 + cpu_to_node[i] = rr; 174 175 rr = next_node(rr, node_online_map); 175 176 if (rr == MAX_NUMNODES) 176 177 rr = first_node(node_online_map); 177 - cpu_to_node[i] = rr; 178 - rr++; 179 178 } 180 179 181 180 }