diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2009-02-03 13:31:36 +1030 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-02 19:17:55 -0800 |
commit | 720eba31f47aeade8ec130ca7f4353223c49170f (patch) | |
tree | 4aef103b59a0fb7b9406fd3e4bb09bdf7e3ad2f7 /lib | |
parent | 27421e211a39784694b597dbf35848b88363c248 (diff) | |
download | op-kernel-dev-720eba31f47aeade8ec130ca7f4353223c49170f.zip op-kernel-dev-720eba31f47aeade8ec130ca7f4353223c49170f.tar.gz |
modules: Use a better scheme for refcounting
Current refcounting for modules (done if CONFIG_MODULE_UNLOAD=y) is
using a lot of memory.
Each 'struct module' contains an [NR_CPUS] array of full cache lines.
This patch uses existing infrastructure (percpu_modalloc() &
percpu_modfree()) to allocate percpu space for the refcount storage.
Instead of wasting NR_CPUS*128 bytes (on i386), we now use
nr_cpu_ids*sizeof(local_t) bytes.
On a typical distro, where NR_CPUS=8, shiping 2000 modules, we reduce
size of module files by about 2 Mbytes. (1Kb per module)
Instead of having all refcounters in the same memory node - with TLB misses
because of vmalloc() - this new implementation permits to have better
NUMA properties, since each CPU will use storage on its preferred node,
thanks to percpu storage.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions