[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150412080704.GC9062@gmail.com>
Date: Sun, 12 Apr 2015 10:07:04 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Linus Torvalds <torvalds@...ux-foundation.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
* Thomas Gleixner <tglx@...utronix.de> wrote:
> > 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.
What kernel config and GCC version did you use?
I used x86-64 defconfig+kvmconfig with GCC 4.9.1, and it gave me:
text filename reduction
12566383 vmlinux.expect=10 [==vanilla]
11923529 vmlinux.-fno-guess-branch-probability -5.4%
11903663 vmlinux.align=1 -5.6%
11646102 vmlinux.align=1+fno-guess-branch-probability -7.9%
So there's still appears to be an additional -2.5% to be gained from
turning off GCC branch heuristics.
x86 defconfig was derived from a distro kernel config and is still
pretty close to what distros typically enable, so it's a good
'typical' config to use for testing.
To double check that assumption I also tested a distro kernel .config
and looked at vmlinux sizes:
text filename reduction
12612201 vmlinux.expect=10 [==vanilla]
12107614 vmlinux.-fno-guess-branch-probability -4.1%
12021817 vmlinux.align=1 -4.9%
11846771 vmlinux.align=1+fno-guess-branch-probability -6.5%
this was cloned from a different major Linux distro than the one the
original x86 defconfig was derived from - still the vmlinux sizes are
pretty similar.
So x86 'make defconfig' measurements are pretty representative if you
are looking for a quick, independent way to measure 'typical Linux
distro' kernel characteristics.
( The only bigger difference is that FUNCTION_TRACER was turned on in
the distro config - which bloats function prologues a bit and thus
reduces the relative savings a bit. )
Thanks,
Ingo
--
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