aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/mm
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2008-04-17 13:12:55 -0400
committerTony Luck <tony.luck@intel.com>2008-04-17 13:12:55 -0400
commitfc494d6c1825de37f04abe147741d50be08403ab (patch)
treeab7b5f8a0732c3b588e958033fddb9029744097e /arch/ia64/mm
parent78514c106b90b628a90c630a3bc87a6538aed865 (diff)
parent2c6e6db41f01b6b4eb98809350827c9678996698 (diff)
Pull percpureserve into release branch
Diffstat (limited to 'arch/ia64/mm')
-rw-r--r--arch/ia64/mm/discontig.c13
-rw-r--r--arch/ia64/mm/numa.c4
2 files changed, 8 insertions, 9 deletions
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index ee5e68b2af94..6136a4c6df11 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -104,7 +104,7 @@ static int __meminit early_nr_cpus_node(int node)
104{ 104{
105 int cpu, n = 0; 105 int cpu, n = 0;
106 106
107 for (cpu = 0; cpu < NR_CPUS; cpu++) 107 for_each_possible_early_cpu(cpu)
108 if (node == node_cpuid[cpu].nid) 108 if (node == node_cpuid[cpu].nid)
109 n++; 109 n++;
110 110
@@ -124,6 +124,7 @@ static unsigned long __meminit compute_pernodesize(int node)
124 pernodesize += node * L1_CACHE_BYTES; 124 pernodesize += node * L1_CACHE_BYTES;
125 pernodesize += L1_CACHE_ALIGN(sizeof(pg_data_t)); 125 pernodesize += L1_CACHE_ALIGN(sizeof(pg_data_t));
126 pernodesize += L1_CACHE_ALIGN(sizeof(struct ia64_node_data)); 126 pernodesize += L1_CACHE_ALIGN(sizeof(struct ia64_node_data));
127 pernodesize += L1_CACHE_ALIGN(sizeof(pg_data_t));
127 pernodesize = PAGE_ALIGN(pernodesize); 128 pernodesize = PAGE_ALIGN(pernodesize);
128 return pernodesize; 129 return pernodesize;
129} 130}
@@ -142,7 +143,7 @@ static void *per_cpu_node_setup(void *cpu_data, int node)
142#ifdef CONFIG_SMP 143#ifdef CONFIG_SMP
143 int cpu; 144 int cpu;
144 145
145 for (cpu = 0; cpu < NR_CPUS; cpu++) { 146 for_each_possible_early_cpu(cpu) {
146 if (node == node_cpuid[cpu].nid) { 147 if (node == node_cpuid[cpu].nid) {
147 memcpy(__va(cpu_data), __phys_per_cpu_start, 148 memcpy(__va(cpu_data), __phys_per_cpu_start,
148 __per_cpu_end - __per_cpu_start); 149 __per_cpu_end - __per_cpu_start);
@@ -345,7 +346,7 @@ static void __init initialize_pernode_data(void)
345 346
346#ifdef CONFIG_SMP 347#ifdef CONFIG_SMP
347 /* Set the node_data pointer for each per-cpu struct */ 348 /* Set the node_data pointer for each per-cpu struct */
348 for (cpu = 0; cpu < NR_CPUS; cpu++) { 349 for_each_possible_early_cpu(cpu) {
349 node = node_cpuid[cpu].nid; 350 node = node_cpuid[cpu].nid;
350 per_cpu(cpu_info, cpu).node_data = mem_data[node].node_data; 351 per_cpu(cpu_info, cpu).node_data = mem_data[node].node_data;
351 } 352 }
@@ -493,13 +494,9 @@ void __cpuinit *per_cpu_init(void)
493 int cpu; 494 int cpu;
494 static int first_time = 1; 495 static int first_time = 1;
495 496
496
497 if (smp_processor_id() != 0)
498 return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
499
500 if (first_time) { 497 if (first_time) {
501 first_time = 0; 498 first_time = 0;
502 for (cpu = 0; cpu < NR_CPUS; cpu++) 499 for_each_possible_early_cpu(cpu)
503 per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu]; 500 per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu];
504 } 501 }
505 502
diff --git a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c
index 7807fc5c0422..b73bf1838e57 100644
--- a/arch/ia64/mm/numa.c
+++ b/arch/ia64/mm/numa.c
@@ -27,7 +27,9 @@
27 */ 27 */
28int num_node_memblks; 28int num_node_memblks;
29struct node_memblk_s node_memblk[NR_NODE_MEMBLKS]; 29struct node_memblk_s node_memblk[NR_NODE_MEMBLKS];
30struct node_cpuid_s node_cpuid[NR_CPUS]; 30struct node_cpuid_s node_cpuid[NR_CPUS] =
31 { [0 ... NR_CPUS-1] = { .phys_id = 0, .nid = NUMA_NO_NODE } };
32
31/* 33/*
32 * This is a matrix with "distances" between nodes, they should be 34 * This is a matrix with "distances" between nodes, they should be
33 * proportional to the memory access latency ratios. 35 * proportional to the memory access latency ratios.