x86: Remove unlikey()s from sched_switch segment tests3.3/likely-unlikely
commitf139dbfe530650ca1b590f3229c6611d3000d80b
authorSteven Rostedt <srostedt@redhat.com>
Tue, 7 Dec 2010 01:58:41 +0000 (6 20:58 -0500)
committerJan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Tue, 20 Mar 2012 09:38:16 +0000 (20 10:38 +0100)
tree247bdd8a14c488b2a90f9720212e09a3d434930d
parentc16fa4f2ad19908a47c63d8fa436a1178438c7e7
x86: Remove unlikey()s from sched_switch segment tests

On a 64bit distro, the chances of having a process using segment registers
is very unlikely. But if the userspace is 32bit running on top of
a 64bit kernel (very common), then this will be very likely that
processes have segment registers in use.

Running on my main desktop (which is a 32bit userspace on top of
a 64bit kernel) the annotated branch profiler showed the following:

 correct incorrect  %        Function             File              Line
 ------- ---------  -        --------             ----              ----
25522442 304125815  92 __switch_to               process_64.c         408
25522430 304123341  92 __switch_to               process_64.c         412
25743877 303891250  92 __switch_to               process_64.c         464

Instead of punishing 32bit userspace systems with an unlikely, just remove
the unlikely and let gcc optimize for what it thinks is good and let
the branch prediction (hopefully) work.

Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
arch/x86/kernel/process_64.c