Account for module percpu space separately from kernel percpu From: Jeremy Fitzhardinge Rather than using a single constant PERCPU_ENOUGH_ROOM, compute it as the sum of kernel_percpu + PERCPU_MODULE_RESERVE. This is taken directly from the x86_64 tree. Signed-off-by: Jeremy Fitzhardinge Signed-off-by: Andi Kleen Cc: Rusty Russell Cc: Eric W. Biederman Cc: Andi Kleen --- include/asm-i386/percpu.h | 10 ++++++++++ 1 file changed, 10 insertions(+) =================================================================== Index: linux/include/asm-i386/percpu.h =================================================================== --- linux.orig/include/asm-i386/percpu.h +++ linux/include/asm-i386/percpu.h @@ -5,6 +5,16 @@ #include #else +#ifdef CONFIG_MODULES +# define PERCPU_MODULE_RESERVE 8192 +#else +# define PERCPU_MODULE_RESERVE 0 +#endif + +#define PERCPU_ENOUGH_ROOM \ + (ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES) + \ + PERCPU_MODULE_RESERVE) + /* * PER_CPU finds an address of a per-cpu variable. *