remove (more or less) unnecessary cacheline_aligned from module_ref
RFC PATCH 1/1 remove (more or less) unnecessary cacheline_aligned from module_ref
On x86_64 systems with CONFIG_MAXSMP set, NR_CPUS is exploded to 4096 cpus. This cacheline_aligned attribute on the local_t in module_ref results in struct module bloating to over 512KB in size on x86_64, which tends to, er, add up. This results in insane disk usage on distro kernel configs (1GB+ on Fedora.)
Killing cacheline_aligned reduces the size of struct module to somewhat more sane levels.
---
I'll followup with a patch to make mod->ref dynamically allocated, but that needs a bit more thinking because module_unload_init currently doesn't have a failure path.
Of course, reducing NR_CPUS to something sane was an easy way to patch over the problem.
include/linux/module.h +1 -1
@@ -222,7 +222,7 @@ void *__symbol_get_gpl(const char *symbol);struct module_ref {local_t count; -}____cacheline_aligned ; +};enum module_state {
Quoted 10 lines · On Monday 12 January 2009 13:48:41 Kyle McMartin wrote:
On
x86_64systems withCONFIG_MAXSMPset,NR_CPUSis exploded to 4096 cpus. Thiscacheline_alignedattribute on thelocal_tinmodule_refresults in struct module bloating to over 512KB in size onx86_64, which tends to, er, add up. This results in insane disk usage on distro kernel configs (1GB+ on Fedora.)Killing
cacheline_alignedreduces the size of struct module to somewhat more sane levels.Signed-off-by Kyle McMartin <[email protected]>
Yep, I've applied this.
Quoted 3 lines
I'll followup with a patch to make
mod->refdynamically allocated, but that needs a bit more thinking becausemodule_unload_initcurrently doesn't have a failure path.
Thanks, that'd be good. And it'll be even nicer when the new per-cpu allocator goes in.
Thanks,
Rusty.
It really needs the per-cpu alloc patches which are pending to make it
Quoted 18 lines
Of course, reducing
NR_CPUSto something sane was an easy way to patch over the problem.include/linux/module.h +1
-1@@ -222,7 +222,7 @@ void *__symbol_get_gpl(const char *symbol);struct module_ref {local_t count; -}____cacheline_aligned ; +};enum module_state {