diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/main.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/init/main.c b/init/main.c index 9cf6b307bfd7..2714e0e7cfec 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -325,7 +325,7 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { } | |||
325 | #else | 325 | #else |
326 | 326 | ||
327 | #ifdef __GENERIC_PER_CPU | 327 | #ifdef __GENERIC_PER_CPU |
328 | unsigned long __per_cpu_offset[NR_CPUS]; | 328 | unsigned long __per_cpu_offset[NR_CPUS] __read_mostly; |
329 | 329 | ||
330 | EXPORT_SYMBOL(__per_cpu_offset); | 330 | EXPORT_SYMBOL(__per_cpu_offset); |
331 | 331 | ||
@@ -343,11 +343,7 @@ static void __init setup_per_cpu_areas(void) | |||
343 | #endif | 343 | #endif |
344 | ptr = alloc_bootmem(size * nr_possible_cpus); | 344 | ptr = alloc_bootmem(size * nr_possible_cpus); |
345 | 345 | ||
346 | for (i = 0; i < NR_CPUS; i++) { | 346 | for_each_cpu(i) { |
347 | if (!cpu_possible(i)) { | ||
348 | __per_cpu_offset[i] = (char*)0 - __per_cpu_start; | ||
349 | continue; | ||
350 | } | ||
351 | __per_cpu_offset[i] = ptr - __per_cpu_start; | 347 | __per_cpu_offset[i] = ptr - __per_cpu_start; |
352 | memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); | 348 | memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); |
353 | ptr += size; | 349 | ptr += size; |