aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc64/kernel/smp.c7
-rw-r--r--include/asm-sparc64/percpu.h10
2 files changed, 12 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index cc09d8266414..0a4958536bcd 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -1447,11 +1447,8 @@ void __init setup_per_cpu_areas(void)
1447 char *ptr; 1447 char *ptr;
1448 1448
1449 /* Copy section for each CPU (we discard the original) */ 1449 /* Copy section for each CPU (we discard the original) */
1450 goal = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES); 1450 goal = PERCPU_ENOUGH_ROOM;
1451#ifdef CONFIG_MODULES 1451
1452 if (goal < PERCPU_ENOUGH_ROOM)
1453 goal = PERCPU_ENOUGH_ROOM;
1454#endif
1455 __per_cpu_shift = 0; 1452 __per_cpu_shift = 0;
1456 for (size = 1UL; size < goal; size <<= 1UL) 1453 for (size = 1UL; size < goal; size <<= 1UL)
1457 __per_cpu_shift++; 1454 __per_cpu_shift++;
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h
index ced8cbde046d..0d3df76aa47f 100644
--- a/include/asm-sparc64/percpu.h
+++ b/include/asm-sparc64/percpu.h
@@ -5,6 +5,16 @@
5 5
6#ifdef CONFIG_SMP 6#ifdef CONFIG_SMP
7 7
8#ifdef CONFIG_MODULES
9# define PERCPU_MODULE_RESERVE 8192
10#else
11# define PERCPU_MODULE_RESERVE 0
12#endif
13
14#define PERCPU_ENOUGH_ROOM \
15 (ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES) + \
16 PERCPU_MODULE_RESERVE)
17
8extern void setup_per_cpu_areas(void); 18extern void setup_per_cpu_areas(void);
9 19
10extern unsigned long __per_cpu_base; 20extern unsigned long __per_cpu_base;