Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753493AbdF2PHD (ORCPT ); Thu, 29 Jun 2017 11:07:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48206 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753232AbdF2PGy (ORCPT ); Thu, 29 Jun 2017 11:06:54 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1E97C93336 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1E97C93336 Date: Thu, 29 Jun 2017 10:06:52 -0500 From: Josh Poimboeuf To: Ingo Molnar Cc: x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Linus Torvalds , Andy Lutomirski , Jiri Slaby , "H. Peter Anvin" , Peter Zijlstra Subject: Re: [PATCH v2 4/8] objtool: add undwarf debuginfo generation Message-ID: <20170629150652.r2dl7f3pzp6cj2i7@treble> References: <20170629072512.pmkfnrgq4dci6od7@gmail.com> <20170629140404.qgcvxhcgm7iywrkb@treble> <20170629144618.vdzem7o6ib5nqab6@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170629144618.vdzem7o6ib5nqab6@gmail.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 29 Jun 2017 15:06:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1235 Lines: 34 On Thu, Jun 29, 2017 at 04:46:18PM +0200, Ingo Molnar wrote: > > * Josh Poimboeuf 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. -- Josh