[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150411142834.GA1898@jtriplet-mobl1>
Date: Sat, 11 Apr 2015 10:28:34 -0400
From: Josh Triplett <josh@...htriplett.org>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jason Low <jason.low2@...com>,
Peter Zijlstra <peterz@...radead.org>,
Davidlohr Bueso <dave@...olabs.net>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Aswin Chandramouleeswaran <aswin@...com>,
LKML <linux-kernel@...r.kernel.org>,
Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...capital.net>,
Denys Vlasenko <dvlasenk@...hat.com>,
Brian Gerst <brgerst@...il.com>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH] x86: Align jump targets to 1 byte boundaries
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 <mingo@...nel.org> 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists