lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFxNbqEGouKAmQ72=skkm8NWBUu7jh92BshFsCwF3r294g@mail.gmail.com>
Date:	Sat, 11 Apr 2015 12:35:58 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Thomas Gleixner <tglx@...utronix.de>,
	Jakub Jelinek <jakub@...hat.com>
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, Apr 11, 2015 at 11:57 AM, Thomas Gleixner <tglx@...utronix.de> wrote:
>
> 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%

Yeah, a 5% code expansion is a big deal. Sadly, it looks like
'no-guess' also disables our explicit likely/unlikely handling.

Damn. If it actually honored likely/unlikely, then we should just do
it - and manually fix up any places where we really care.

But the fact that it apparently entirely disables not just the
guesses, but our *explicit* likely/unlikely, means that we can't fix
up the mistakes.

And in many of the hot codepaths that likely/unlikely really does
matter. Some of our hottest paths have known "this basically never
happens" situations that we do *not* want to break up our L1 I$ over.
There's a number of functions that have been optimized to really
generate good code, and "-fno-guess-branch-probability" disables those
manual optimizations.

So we'd have no way to fix it for the cases that matter.

Sad.

It might be worth bringing this up with some gcc people. I added Jakub
to the cc. Any other gcc people suggestions?

                            Linus
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ