linux/tools/objtool
Peter Zijlstra 25cf0d8aa2 objtool: Rewrite hashtable sizing
Currently objtool has 5 hashtables and sizes them 16 or 20 bits
depending on the --vmlinux argument.

However, a single side doesn't really work well for the 5 tables,
which among them, cover 3 different uses. Also, while vmlinux is
larger, there is still a very wide difference between a defconfig and
allyesconfig build, which again isn't optimally covered by a single
size.

Another aspect is the cost of elf_hash_init(), which for large tables
dominates the runtime for small input files. It turns out that all it
does it assign NULL, something that is required when using malloc().
However, when we allocate memory using mmap(), we're guaranteed to get
zero filled pages.

Therefore, rewrite the whole thing to:

 1) use more dynamic sized tables, depending on the input file,
 2) avoid the need for elf_hash_init() entirely by using mmap().

This speeds up a regular kernel build (100s to 98s for
x86_64-defconfig), and potentially dramatically speeds up vmlinux
processing.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210506194157.452881700@infradead.org
2021-05-12 14:54:50 +02:00
..
arch/x86 Objtool updates in this cycle were: 2021-04-28 12:53:24 -07:00
Documentation objtool: Support stack layout changes in alternatives 2021-01-14 09:53:54 -06:00
include/objtool objtool: Rewrite hashtable sizing 2021-05-12 14:54:50 +02:00
.gitignore objtool: Rework header include paths 2021-01-13 18:13:14 -06:00
Build objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00
builtin-check.c objtool: Parse options from OBJTOOL_ARGS 2021-03-06 12:44:23 +01:00
builtin-orc.c objtool: Collate parse_options() users 2021-03-06 12:44:23 +01:00
check.c Objtool updates in this cycle were: 2021-04-28 12:53:24 -07:00
elf.c objtool: Rewrite hashtable sizing 2021-05-12 14:54:50 +02:00
Makefile objtool: Refactor ORC section generation 2021-01-14 09:53:42 -06:00
objtool.c Objtool updates in this cycle were: 2021-04-28 12:53:24 -07:00
orc_dump.c x86/unwind/orc: Change REG_SP_INDIRECT 2021-02-10 20:53:51 +01:00
orc_gen.c objtool: Create reloc sections implicitly 2021-04-02 12:44:37 +02:00
special.c objtool: Skip magical retpoline .altinstr_replacement 2021-04-02 12:46:57 +02:00
sync-check.sh Merge branch 'x86/cpu' into WIP.x86/core, to merge the NOP changes & resolve a semantic conflict 2021-04-02 12:36:30 +02:00
weak.c objtool: Refactor ORC section generation 2021-01-14 09:53:42 -06:00