Modules: Remove PERCPU_ENOUGH_ROOM The constant is now useless since the modules subsystem can expand its per cpu area as needed. Signed-off-by: Christoph Lameter --- arch/powerpc/kernel/setup_64.c | 5 ----- arch/sparc64/kernel/smp.c | 2 +- arch/x86/kernel/setup64.c | 4 ++-- include/asm-ia64/percpu.h | 2 -- include/linux/percpu.h | 7 ------- init/main.c | 2 +- kernel/lockdep.c | 3 +-- 7 files changed, 5 insertions(+), 20 deletions(-) Index: linux-2.6/include/asm-ia64/percpu.h =================================================================== --- linux-2.6.orig/include/asm-ia64/percpu.h 2007-11-21 12:44:59.386608425 -0800 +++ linux-2.6/include/asm-ia64/percpu.h 2007-11-21 12:56:08.086858220 -0800 @@ -6,8 +6,6 @@ * David Mosberger-Tang */ -#define PERCPU_ENOUGH_ROOM PERCPU_PAGE_SIZE - #ifdef __ASSEMBLY__ # define THIS_CPU(var) (per_cpu__##var) /* use this to mark accesses to per-CPU variables... */ #else /* !__ASSEMBLY__ */ Index: linux-2.6/include/linux/percpu.h =================================================================== --- linux-2.6.orig/include/linux/percpu.h 2007-11-21 12:55:40.198608193 -0800 +++ linux-2.6/include/linux/percpu.h 2007-11-21 12:56:37.394857848 -0800 @@ -9,13 +9,6 @@ #include - -/* - * Legacy definitions. The module loader can extend the per cpu - * section as needed now. - */ -#define PERCPU_ENOUGH_ROOM (__per_cpu_end - __per_cpu_start) - DECLARE_PER_CPU(cpumask_t, cpu_mask); /* Index: linux-2.6/arch/powerpc/kernel/setup_64.c =================================================================== --- linux-2.6.orig/arch/powerpc/kernel/setup_64.c 2007-11-21 12:44:59.402608654 -0800 +++ linux-2.6/arch/powerpc/kernel/setup_64.c 2007-11-21 12:56:08.115108217 -0800 @@ -582,11 +582,6 @@ void __init setup_per_cpu_areas(void) /* Copy section for each CPU (we discard the original) */ size = ALIGN(__per_cpu_end - __per_cpu_start, PAGE_SIZE); -#ifdef CONFIG_MODULES - if (size < PERCPU_ENOUGH_ROOM) - size = PERCPU_ENOUGH_ROOM; -#endif - for_each_possible_cpu(i) { ptr = alloc_bootmem_pages_node(NODE_DATA(cpu_to_node(i)), size); if (!ptr) Index: linux-2.6/arch/sparc64/kernel/smp.c =================================================================== --- linux-2.6.orig/arch/sparc64/kernel/smp.c 2007-11-21 12:44:59.410608586 -0800 +++ linux-2.6/arch/sparc64/kernel/smp.c 2007-11-21 12:56:08.115108217 -0800 @@ -1427,7 +1427,7 @@ void __init real_setup_per_cpu_areas(voi char *ptr; /* Copy section for each CPU (we discard the original) */ - goal = PERCPU_ENOUGH_ROOM; + goal = __per_cpu_end - __per_cpu_start; __per_cpu_shift = PAGE_SHIFT; for (size = PAGE_SIZE; size < goal; size <<= 1UL) Index: linux-2.6/init/main.c =================================================================== --- linux-2.6.orig/init/main.c 2007-11-21 12:45:16.219608253 -0800 +++ linux-2.6/init/main.c 2007-11-21 12:56:08.115108217 -0800 @@ -380,7 +380,7 @@ static void __init setup_per_cpu_areas(v unsigned long nr_possible_cpus = num_possible_cpus(); /* Copy section for each CPU (we discard the original) */ - size = ALIGN(PERCPU_ENOUGH_ROOM, PAGE_SIZE); + size = ALIGN(__per_cpu_end - __per_cpu_start, PAGE_SIZE); ptr = alloc_bootmem_pages(size * nr_possible_cpus); for_each_possible_cpu(i) { Index: linux-2.6/arch/x86/kernel/setup64.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/setup64.c 2007-11-21 12:44:59.418608388 -0800 +++ linux-2.6/arch/x86/kernel/setup64.c 2007-11-21 12:56:08.115108217 -0800 @@ -94,7 +94,7 @@ void __init setup_per_cpu_areas(void) #endif /* Copy section for each CPU (we discard the original) */ - size = PERCPU_ENOUGH_ROOM; + size = __per_cpu_end - __per_cpu_start; printk(KERN_INFO "PERCPU: Allocating %lu bytes of per cpu data\n", size); for_each_cpu_mask (i, cpu_possible_map) { @@ -110,7 +110,7 @@ void __init setup_per_cpu_areas(void) if (!ptr) panic("Cannot allocate cpu data for CPU %d\n", i); cpu_pda(i)->data_offset = ptr - __per_cpu_start; - memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); + memcpy(ptr, __per_cpu_start, size); } } Index: linux-2.6/kernel/lockdep.c =================================================================== --- linux-2.6.orig/kernel/lockdep.c 2007-11-21 12:44:59.434608654 -0800 +++ linux-2.6/kernel/lockdep.c 2007-11-21 12:56:08.118608338 -0800 @@ -610,8 +610,7 @@ static int static_obj(void *obj) */ for_each_possible_cpu(i) { start = (unsigned long) &__per_cpu_start + per_cpu_offset(i); - end = (unsigned long) &__per_cpu_start + PERCPU_ENOUGH_ROOM - + per_cpu_offset(i); + end = (unsigned long) &__per_cpu_end + per_cpu_offset(i); if ((addr >= start) && (addr < end)) return 1;