Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932673AbbDKO27 (ORCPT ); Sat, 11 Apr 2015 10:28:59 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:40036 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755203AbbDKO26 (ORCPT ); Sat, 11 Apr 2015 10:28:58 -0400 X-Originating-IP: 66.171.172.34 Date: Sat, 11 Apr 2015 10:28:34 -0400 From: Josh Triplett To: "Paul E. McKenney" Cc: Ingo Molnar , Linus Torvalds , Jason Low , Peter Zijlstra , Davidlohr Bueso , Tim Chen , Aswin Chandramouleeswaran , LKML , Borislav Petkov , Andy Lutomirski , Denys Vlasenko , Brian Gerst , "H. Peter Anvin" , Thomas Gleixner , Peter Zijlstra Subject: Re: [PATCH] x86: Align jump targets to 1 byte boundaries Message-ID: <20150411142834.GA1898@jtriplet-mobl1> References: <20150409183926.GM6464@linux.vnet.ibm.com> <20150410090051.GA28549@gmail.com> <20150410091252.GA27630@gmail.com> <20150410092152.GA21332@gmail.com> <20150410111427.GA30477@gmail.com> <20150410112748.GB30477@gmail.com> <20150410120846.GA17101@gmail.com> <20150410141008.GX6464@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150410141008.GX6464@linux.vnet.ibm.com> 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: 1906 Lines: 42 On Fri, Apr 10, 2015 at 07:10:08AM -0700, Paul E. McKenney wrote: > On Fri, Apr 10, 2015 at 02:08:46PM +0200, Ingo Molnar wrote: > > * Ingo Molnar wrote: [...] > > Btw., totally off topic, the following NOP caught my attention: > > > > > 5a: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) > > > > That's a dead NOP that boats the function a bit, added for the 16 byte > > alignment of one of the jump targets. > > > > I realize that x86 CPU manufacturers recommend 16-byte jump target > > alignments (it's in the Intel optimization manual), but the cost of > > that is very significant: > > > > text data bss dec filename > > 12566391 1617840 1089536 15273767 vmlinux.align.16-byte > > 12224951 1617840 1089536 14932327 vmlinux.align.1-byte > > > > By using 1 byte jump target alignment (i.e. no alignment at all) we > > get an almost 3% reduction in kernel size (!) - and a probably similar > > reduction in I$ footprint. > > > > So I'm wondering, is the 16 byte jump target optimization suggestion > > really worth this price? The patch below boots fine and I've not > > measured any noticeable slowdown, but I've not tried hard. > > Good point, adding Josh Triplett on CC. I suspect that he might be > interested. ;-) Quite interested, yes. Even if there *are* benchmarks to support keeping the optimization (which wouldn't surprise me), it'd be nice to have a Kconfig option to enable the jump-target optimization. (With 'y' meaning "pad jump targets to 16 bytes", so that allnoconfig and tinyconfig automatically don't.) - Josh Triplett -- 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/