[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1504112038590.3845@nanos>
Date: Sat, 11 Apr 2015 20:57:52 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Linus Torvalds <torvalds@...ux-foundation.org>
cc: Ingo Molnar <mingo@...nel.org>,
Denys Vlasenko <dvlasenk@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Andy Lutomirski <luto@...capital.net>,
Jason Low <jason.low2@...com>, Brian Gerst <brgerst@...il.com>,
Aswin Chandramouleeswaran <aswin@...com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Davidlohr Bueso <dave@...olabs.net>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
"H. Peter Anvin" <hpa@...or.com>,
LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] x86: Turn off GCC branch probability heuristics
On Sat, 11 Apr 2015, Linus Torvalds wrote:
> On Apr 11, 2015 2:20 AM, "Ingo Molnar" <mingo@...nel.org> wrote:
> >
> > Another thing caught my attention (and I'm hijacking the RCU thread
> > again): GCC's notion of how to place branches seems somewhat random,
> > and rather bloaty.
> >
> > So I tried the experiment below on an x86 defconfig, turning off GCC's
> > branch heuristics, and it's rather surprising:
> >
> > text data bss dec filename
> > 12566447 1617840 1089536 15273823 vmlinux.fguess-branch-probability
> > 11923593 1617840 1089536 14630969 vmlinux.fno-guess-branch-probability
> >
> > That's an 5.4% code size improvement!
>
> Ugh. That's much larger than I would have expected. Is it just because
> gcc ends up turning
>
> if (a)
> b
> c
>
> into
>
> if (a) goto out-of-line
> return:
> c
> ..
> out-of-line:
> c
> goto return;
>
> a lot? Still, 5% sounds insanely big.
>
> How much of that 5% comes from code alignment? Or was this on *top* of
> the 1-byte alignment testt?
I thinks its just the no-guess one:
text data dec patch reduction
7563475 1781048 10302987
7192973 1780024 9931461 no-guess -4.8%
7354819 1781048 958464 align-1 -2.7%
7192973 1780024 9931461 no-guess + align-1 -4.8%
So with the no-guess applied the align-1 does not matter anymore.
Thanks,
tglx
--
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