objtool: Reduce memory usage with CONFIG_DEBUG_INFO
Status from this message: The following commit has been merged into the objtool/core branch of tip:
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/22 | objtool: Tidy elf.htools/ | +47 | 0 replies | |
| 2/22 | objtool: Remove flags argument from elf_create_section()tools/ tools/ tools/ +1 more | +18 | 0 replies | |
| 3/22 | objtool: Improve reloc namingtools/ tools/ tools/ | +151 | 0 replies | |
| 4/22 | objtool: Consolidate rel/rela handlingtools/ tools/ tools/ | +68 | 0 replies | |
| 5/22 | objtool: Fix reloc_hash sizetools/ tools/ | +14 | 0 replies | |
| 6/22 | objtool: Add mark_sec_changed()tools/ tools/ | +29 | 0 replies | |
| 7/22 | objtool: Add elf_create_section_pair()tools/ tools/ tools/ +3 more | +184 | 0 replies | |
| 8/22 | objtool: Keep GElf_Rel[a] structs syncedtools/ | +14 | 0 replies | |
| 9/22 | objtool: Don't free memory in elf_close()tools/ | +4 | 0 replies | |
| 10/22 | objtool: Add for_each_reloc()tools/ tools/ | +18 | 0 replies | |
| 11/22 | objtool: Allocate relocs in advance for new rela sectionstools/ | +13 | 0 replies | |
| 12/22 | objtool: Get rid of reloc->listtools/ tools/ | +26 | 0 replies | |
| 13/22 | objtool: Get rid of reloc->idxtools/ tools/ | +9 | 0 replies | |
| 14/22 | objtool: Get rid of reloc->offsettools/ tools/ tools/ | +18 | 0 replies | |
| 15/22 | objtool: Get rid of reloc->typetools/ tools/ tools/ +2 more | +21 | 0 replies | |
| 16/22 | objtool: Get rid of reloc->addendtools/ tools/ tools/ +3 more | +53 | 0 replies | |
| 17/22 | objtool: Get rid of reloc->jump_table_starttools/ tools/ | +23 | 0 replies | |
| 18/22 | objtool: Shrink reloc->sym_reloc_entrytools/ tools/ | +7 | 0 replies | |
| 19/22 | objtool: Shrink elf hash nodestools/ tools/ | +58 | 0 replies | |
| 20/22 | objtool: Get rid of reloc->rel[a]tools/ tools/ tools/ | +96 | 0 replies | |
| 21/22 | objtool: Free insns when donetools/ | +30 | 0 replies | |
| 22/22 | objtool: Skip reading DWARF section datatools/ | +6 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/22] objtool: Reduce memory usage with CONFIG_DEBUG_INFO
DWARF uses a LOT of relocations, causing objtool to need a LOT of memory for processing vmlinux.o.
In the worst case of an allyesconfig+CONFIG_DEBUG_INFO kernel, DWARF creates almost 200 million relocations, ballooning objtool's peak heap usage to 53GB. These patches reduce that to 25GB.
On a distro-type kernel with kernel IBT enabled, they reduce objtool's peak heap usage from 4.2GB to 2.8GB.
They also improve the runtime significantly (from 2m50s to 1m54s on my system with allyesconfig+CONFIG_DEBUG_INFO), though most of that comes from fixing the size calculation for reloc_hash.
Josh Poimboeuf (22):
objtool: Tidy elf.h
objtool: Remove flags argument from elf_create_section()
objtool: Improve reloc naming
objtool: Consolidate rel/rela handling
objtool: Fix reloc_hash size
objtool: Add mark_sec_changed()
objtool: Add elf_create_section_pair()
objtool: Keep GElf_Rel[a] structs synced
objtool: Don't free memory in elf_close()
objtool: Add for_each_reloc()
objtool: Allocate relocs in advance for new rela sections
objtool: Get rid of reloc->list
objtool: Get rid of reloc->idx
objtool: Get rid of reloc->offset
objtool: Get rid of reloc->type
objtool: Get rid of reloc->addend
objtool: Get rid of reloc->jump_table_start
objtool: Shrink reloc->sym_reloc_entry
objtool: Shrink elf hash nodes
objtool: Get rid of reloc->rel[a]
objtool: Free insns when done
objtool: Skip reading DWARF section data
tools/objtool/arch/powerpc/include/arch/elf.h | 11 +- tools/objtool/arch/x86/decode.c | 6 +- tools/objtool/arch/x86/include/arch/elf.h | 11 +- tools/objtool/arch/x86/special.c | 6 +- tools/objtool/check.c | 429 +++++++------- tools/objtool/elf.c | 537 +++++++----------- tools/objtool/include/objtool/elf.h | 326 ++++++++--- tools/objtool/orc_gen.c | 8 +- tools/objtool/special.c | 4 +- 9 files changed, 698 insertions(+), 640 deletions(-)
Signature · 1 line
2.40.1