diff options
| author | Ingo Molnar <mingo@elte.hu> | 2012-02-28 10:26:07 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2012-02-28 10:27:36 +0100 |
| commit | 458ce2910aa83d8a2cafb489d727f7da839e73c6 (patch) | |
| tree | 28e088137eb068e5620f17eaf0ca19d1562006ed /include/linux/module.h | |
| parent | 69466466ce889cd2cbc8cda9ff1c6083f48cc7f9 (diff) | |
| parent | 586c6e7013c8cbb8c91aaa6568ec349b1dc2c691 (diff) | |
Merge branch 'linus' into x86/asm
Sync up the latest NMI fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/module.h')
| -rw-r--r-- | include/linux/module.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 3cb7839a60b9..4598bf03e98b 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -205,6 +205,20 @@ enum module_state MODULE_STATE_GOING, }; +/** + * struct module_ref - per cpu module reference counts + * @incs: number of module get on this cpu + * @decs: number of module put on this cpu + * + * We force an alignment on 8 or 16 bytes, so that alloc_percpu() + * put @incs/@decs in same cache line, with no extra memory cost, + * since alloc_percpu() is fine grained. + */ +struct module_ref { + unsigned long incs; + unsigned long decs; +} __attribute((aligned(2 * sizeof(unsigned long)))); + struct module { enum module_state state; @@ -347,10 +361,7 @@ struct module /* Destruction function. */ void (*exit)(void); - struct module_ref { - unsigned int incs; - unsigned int decs; - } __percpu *refptr; + struct module_ref __percpu *refptr; #endif #ifdef CONFIG_CONSTRUCTORS @@ -434,7 +445,7 @@ extern void __module_put_and_exit(struct module *mod, long code) #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code); #ifdef CONFIG_MODULE_UNLOAD -unsigned int module_refcount(struct module *mod); +unsigned long module_refcount(struct module *mod); void __symbol_put(const char *symbol); #define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) void symbol_put_addr(void *addr); |
