The per cpu reserve from which loadable modules allocate their percpu sections
is currently fixed at 8000 bytes.
Add a new kernel parameter
percpu=<dynamically allocatable percpu bytes>
The per cpu reserve area will be used in following patches by the
per cpu allocator.
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
---
arch/ia64/include/asm/percpu.h | 1 +
include/linux/percpu.h | 7 ++++++-
init/main.c | 13 +++++++++++++
3 files changed, 20 insertions(+), 1 deletion(-)
Index: linux-2.6/include/linux/percpu.h
===================================================================
--- linux-2.6.orig/include/linux/percpu.h 2008-09-16 18:14:58.000000000 -0700
+++ linux-2.6/include/linux/percpu.h 2008-09-16 18:21:01.000000000 -0700
@@ -34,6 +34,7 @@
#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
+extern unsigned int percpu_reserve;
/* Enough to cover all DEFINE_PER_CPUs in kernel, including modules. */
#ifndef PERCPU_ENOUGH_ROOM
#ifdef CONFIG_MODULES
@@ -43,7 +44,7 @@
#endif
#define PERCPU_ENOUGH_ROOM \
- (__per_cpu_end - __per_cpu_start + PERCPU_MODULE_RESERVE)
+ (__per_cpu_end - __per_cpu_start + percpu_reserve)
#endif /* PERCPU_ENOUGH_ROOM */
/*
Index: linux-2.6/init/main.c
===================================================================
--- linux-2.6.orig/init/main.c 2008-09-16 18:14:59.000000000 -0700
+++ linux-2.6/init/main.c 2008-09-16 18:24:12.000000000 -0700
@@ -253,6 +253,16 @@ static int __init loglevel(char *str)
early_param("loglevel", loglevel);
+unsigned int percpu_reserve = PERCPU_MODULE_RESERVE;
+
+static int __init init_percpu_reserve(char *str)
+{
+ get_option(&str, &percpu_reserve);
+ return 0;
+}
+
+early_param("percpu=", init_percpu_reserve);
+
/*
* Unknown boot options get handed to init, unless they look like
* failed parameters
@@ -397,6 +407,9 @@ static ...