]> git.karo-electronics.de Git - karo-tx-linux.git/commit
module: Fix performance regression on modules with large symbol tables
authorKevin Cernekee <cernekee@gmail.com>
Sun, 4 Dec 2011 23:33:31 +0000 (10:33 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sun, 4 Dec 2011 23:33:31 +0000 (10:33 +1100)
commite2fe4163e36947385b3581fa047ff2e7665f084a
treec6b0a6fdfb235142f4df3a8d661976ea08d3d6d2
parent83ef4f293e568c3b1584f96f153ec74c1ba21c37
module: Fix performance regression on modules with large symbol tables

Looking at /proc/kallsyms, one starts to ponder whether all of the extra
strtab-related complexity in module.c is worth the memory savings.

Instead of making the add_kallsyms() loop even more complex, I tried the
other route of deleting the strmap logic and naively copying each string
into core_strtab with no consideration for consolidating duplicates.

Performance on an "already exists" insmod of nvidia.ko (runs
add_kallsyms() but does not actually initialize the module):

Original scheme: 1.230s
With naive copying: 0.058s

Extra space used: 35k (of a 408k module).

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
LKML-Reference: <73defb5e4bca04a6431392cc341112b1@localhost>
kernel/module.c