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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170706203636.lcwfjsphmy2q464v@treble>
Date:   Thu, 6 Jul 2017 15:36:36 -0500
From:   Josh Poimboeuf <jpoimboe@...hat.com>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        live-patching@...r.kernel.org,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Andy Lutomirski <luto@...nel.org>, Jiri Slaby <jslaby@...e.cz>,
        "H. Peter Anvin" <hpa@...or.com>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v2 4/8] objtool: add undwarf debuginfo generation

On Thu, Jun 29, 2017 at 10:06:52AM -0500, Josh Poimboeuf wrote:
> On Thu, Jun 29, 2017 at 04:46:18PM +0200, Ingo Molnar wrote:
> > 
> > * Josh Poimboeuf <jpoimboe@...hat.com> wrote:
> > 
> > > > Plus, shouldn't we use __packed for 'struct undwarf' to minimize the 
> > > > structure's size (to 6 bytes AFAICS?) - or is optimal packing of the main 
> > > > undwarf array already guaranteed on every platform with this layout?
> > > 
> > > Ah yes, it should definitely be packed (assuming that doesn't affect performance 
> > > negatively).
> > 
> > So if I count that correctly that should shave another ~1MB off a typical ~4MB 
> > table size?
> 
> Here's what my Fedora kernel looks like *before* the packed change:
> 
>   $ eu-readelf -S vmlinux |grep undwarf
>   [15] .undwarf_ip          PROGBITS     ffffffff81f776d0 011776d0 0012d9d0  0 A      0   0  1
>   [16] .undwarf             PROGBITS     ffffffff820a50a0 012a50a0 0025b3a0  0 A      0   0  1
> 
> The total undwarf data size is ~3.5MB.
> 
> There are 308852 entries of two parallel arrays:
> 
> * .undwarf    (8 bytes/entry) = 2470816 bytes
> * .undwarf_ip (4 bytes/entry) = 1235408 bytes
> 
> If we pack undwarf, reducing the size of the .undwarf entries by two
> bytes, it will save 308852 * 2 = 617704.
> 
> So the savings will be ~600k, and the typical size will be reduced to ~3MB.

Just for the record, while packing the struct from 8 to 6 bytes did save
600k, it also made the unwinder ~7% slower.  I think that's probably an
ok tradeoff, so I'll leave it packed in v3.

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ