Skip to content

module: Speed up symbol resolution during module loading (using binary search)

Alan Jenkins linux-kbuild lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10ARM: use unified discard definition in linker scriptarch/arm/kernel/vmlinux.lds.S+8 -50 replies
2/10ARM: unexport symbols used to implement floating point emulationarch/arm/kernel/armksyms.c+0 -200 replies
3/10module: make MODULE_SYMBOL_PREFIX into a CONFIG optionarch/blackfin/Kconfig arch/blackfin/include/asm/module.h arch/blackfin/kernel/vmlinux.lds.S +9 more+33 -210 replies
4/10module: extract EXPORT_SYMBOL() from module.h into mod_export.hinclude/linux/mod_export.h include/linux/module.h+76 -640 replies
5/10kbuild: sort the list of symbols exported by the kernel (__ksymtab)Makefile include/asm-generic/vmlinux.lds.h include/linux/mod_export.h +3 more+193 -240 replies
6/10module: refactor symbol tables and try to reduce code size of each_symbol()include/linux/module.h kernel/module.c+183 -1600 replies
7/10lib: Add generic binary search function to the kernel.include/linux/bsearch.h lib/Makefile lib/bsearch.c+63 -10 replies
8/10lib: bsearch - remove redundant special case for arrays of size 0lib/bsearch.c+0 -20 replies
9/10module: speed up find_symbol() using binary search on the builtin symbol tableskernel/module.c+91 -530 replies
10/10module: fix is_exported() to return true for all types of exportskernel/module.c+8 -221 reply

Reviews trailers per patch

2 of 10 patches have a Reviewed-by or Acked-by.

PatchRussell KingMike Frysinger
1/10A-b
2/10
3/10A-b
4/10
5/10
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/10] module: Speed up symbol resolution during module loading (using binary search)

As requested by Mike Frysinger, this version of the series

1) generalizes the use of CONFIG_SYMBOL_PREFIX so that arbitrary symbol prefixes remain possible
2) uses CONFIG_SYMBOL_PREFIX to implement VMLINUX_SYMBOL() in the generic linker script, instead of relying on arch linker scripts to define it if needed.

I also changed the position of the patch which implements the above changes. So it is possible to revert or drop the actual optimizations, without removing the cleanups and annoying Mike (or Rusty, or Tejun Heo, or miscellaneous fans of lib/bsearch.c :).

A clean revert may be useful if hash tables are added in future, to avoid the complexity of keeping hash tables + sorted tables + unsorted tables. (This current series leaves module symbol tables unsorted).