lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <cover.1685464332.git.jpoimboe@kernel.org>
Date:   Tue, 30 May 2023 10:20:52 -0700
From:   Josh Poimboeuf <jpoimboe@...nel.org>
To:     x86@...nel.org
Cc:     linux-kernel@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.org>,
        Miroslav Benes <mbenes@...e.cz>
Subject: [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(-)

-- 
2.40.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ