Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754993AbbDNMKH (ORCPT ); Tue, 14 Apr 2015 08:10:07 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:33844 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753657AbbDNMJ7 (ORCPT ); Tue, 14 Apr 2015 08:09:59 -0400 Date: Tue, 14 Apr 2015 14:09:55 +0200 From: Ingo Molnar To: Markus Trippelsdorf Cc: Linus Torvalds , "H. Peter Anvin" , Denys Vlasenko , "Paul E. McKenney" , Jason Low , Peter Zijlstra , Davidlohr Bueso , Tim Chen , Aswin Chandramouleeswaran , LKML , Borislav Petkov , Andy Lutomirski , Brian Gerst , Thomas Gleixner , Peter Zijlstra Subject: Re: [PATCH] x86: Align jump targets to 1 byte boundaries Message-ID: <20150414120954.GA23761@gmail.com> References: <20150411144135.GB31416@x4> <20150412101422.GA2862@gmail.com> <20150413162308.GB398@x4> <20150413172624.GC398@x4> <20150413190914.GA398@x4> <20150414053821.GA28321@gmail.com> <20150414082346.GB398@x4> <20150414091615.GA10345@gmail.com> <20150414111706.GC398@x4> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150414111706.GC398@x4> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1812 Lines: 48 * Markus Trippelsdorf wrote: > > I'm not so sure about that one, our data access patterns are > > usually a lot more well thought out than our code alignment (which > > is really mostly compiler controlled). It also gives limited > > savings: > > > > 9202488 vmlinux gcc-5 > > 9186105 vmlinux gcc-5 (-malign-data=abi) > > > > Which is 0.1%. I've got a handful of options in that size range: > > > > + # Reduces vmlinux size by 0.25%: > > + KBUILD_CFLAGS += -fno-caller-saves > > + > > + # Reduces vmlinux size by 1.10%: > > + KBUILD_CFLAGS += -fno-inline-small-functions > > + > > + # Reduces vmlinux size by about 0.95%: > > + KBUILD_CFLAGS += -fno-tree-ch > > > > but obviously they are more obscure and thus riskier. Find below > > an updated "Ingo's combo patch". It gives more than 10% savings > > here on x86 defconfig using gcc 4.9, without LTO. > > Well obviously, if you do not care about performance you can reduce > the text size further and further. [...] Yes, but I picked GCC options that I don't think impact performance negatively and offer a sizable debloating effect. Especially with inlining if code size increases it's probably a net loss. > [...] But what is interesting is to keep the performance up (or even > increase it) and still reduce the text size. By my (admittedly quick) review I think those 3 extra options I added still generate pretty OK code in the end. I.e. they are not like -Os that generates utter crap to save a byte. Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/