per-cpu data in modules.
Subsystems (2)
PATCH 1/1 per-cpu data in modules.
Hi Andrew,
This uses the previous __alloc_percpu patch, to allow per-cpu
data within modules.
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Name: per-cpu support inside modules
Author: Rusty Russell
Status: Tested on 2.5.69
Depends: Misc/kmalloc_percpu.patch.gz
D: This adds percpu support for modules.
include/linux/module.h +3 -0
@@ -247,6 +247,9 @@ struct modulechar *strtab;#endif +/* Per-cpu data. */ +void *percpu; +/* The command line arguments (may be mangled). People like keeping pointers to this stuff */ char *args;
include/linux/percpu.h +0 -5
@@ -31,10 +31,8 @@ extern void kfree_percpu(const void *);extern unsigned long __per_cpu_offset[NR_CPUS ];/* Separate out the type, so (int[3], foo) works. */ -#ifndef MODULE #define DEFINE_PER_CPU (type, name) \ __attribute__((__section__(".data.percpu"))) __typeof__(type) name##__per_cpu -#endif /* var is in discarded region: offset to particular copy we want */ #define per_cpu (var, cpu) (*RELOC_HIDE(&var##__per_cpu, __per_cpu_offset[cpu]))
@@ -43,11 +41,8 @@ extern unsigned long __per_cpu_offset[NRextern void setup_per_cpu_areas (void );#else /* !CONFIG_SMP */ -/* Can't define per-cpu variables in modules. Sorry --RR */ -#ifndef MODULE #define DEFINE_PER_CPU (type, name) \ __typeof__(type) name##__per_cpu -#endif #define per_cpu (var, cpu) ((void)(cpu), var##__per_cpu)#define __get_cpu_var (var) var##__per_cpu
kernel/module.c +37 -7
101 lines not on this page · raw message