aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/numa_64.c
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2007-10-17 12:04:39 -0400
committerThomas Gleixner <tglx@inhelltoy.tec.linutronix.de>2007-10-17 14:16:37 -0400
commit98c9e27a56a2d9f9148992b0b9a9a36760ea4eb9 (patch)
tree1f454309248477977d6654ee57480ef18140dce6 /arch/x86/mm/numa_64.c
parent6b556ffc4b8fc71445156bcdd02a16a364a36356 (diff)
x86: fix cpu_to_node references
In x86_64 and i386 architectures most arrays that are sized using NR_CPUS lay in local memory on node 0. Not only will most (99%?) of the systems not use all the slots in these arrays, particularly when NR_CPUS is increased to accommodate future very high cpu count systems, but a number of cache lines are passed unnecessarily on the system bus when these arrays are referenced by cpus on other nodes. Typically, the values in these arrays are referenced by the cpu accessing it's own values, though when passing IPI interrupts, the cpu does access the data relevant to the targeted cpu/node. Of course, if the referencing cpu is not on node 0, then the reference will still require cross node exchanges of cache lines. A common use of this is for an interrupt service routine to pass the interrupt to other cpus local to that node. Ideally, all the elements in these arrays should be moved to the per_cpu data area. In some cases (such as x86_cpu_to_apicid) the array is referenced before the per_cpu data areas are setup. In this case, a static array is declared in the __initdata area and initialized by the booting cpu (BSP). The values are then moved to the per_cpu area after it is initialized and the original static array is freed with the rest of the __initdata. This patch: Fix four instances where cpu_to_node is referenced by array instead of via the cpu_to_node macro. This is preparation to moving it to the per_cpu data area. Signed-off-by: Mike Travis <travis@sgi.com> Cc: Andi Kleen <ak@suse.de> Cc: Christoph Lameter <clameter@sgi.com> Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/numa_64.c')
-rw-r--r--arch/x86/mm/numa_64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 97e8ac75568f..5eec5e56d07f 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -261,7 +261,7 @@ void __init numa_init_array(void)
261 We round robin the existing nodes. */ 261 We round robin the existing nodes. */
262 rr = first_node(node_online_map); 262 rr = first_node(node_online_map);
263 for (i = 0; i < NR_CPUS; i++) { 263 for (i = 0; i < NR_CPUS; i++) {
264 if (cpu_to_node[i] != NUMA_NO_NODE) 264 if (cpu_to_node(i) != NUMA_NO_NODE)
265 continue; 265 continue;
266 numa_set_node(i, rr); 266 numa_set_node(i, rr);
267 rr = next_node(rr, node_online_map); 267 rr = next_node(rr, node_online_map);
@@ -543,7 +543,7 @@ __cpuinit void numa_add_cpu(int cpu)
543void __cpuinit numa_set_node(int cpu, int node) 543void __cpuinit numa_set_node(int cpu, int node)
544{ 544{
545 cpu_pda(cpu)->nodenumber = node; 545 cpu_pda(cpu)->nodenumber = node;
546 cpu_to_node[cpu] = node; 546 cpu_to_node(cpu) = node;
547} 547}
548 548
549unsigned long __init numa_free_all_bootmem(void) 549unsigned long __init numa_free_all_bootmem(void)