Steven Rostedt (VMware) 4009f4b3a9 locking/rtmutex: Flip unlikely() branch to likely() in __rt_mutex_slowlock()
Running my likely/unlikely profiler for 3 weeks on two production
machines, I discovered that the unlikely() test in
__rt_mutex_slowlock() checking if state is TASK_INTERRUPTIBLE is hit
100% of the time, making it a very likely case.

The reason is, on a vanilla kernel, the majority case of calling
rt_mutex() is from the futex code. This code is always called as
TASK_INTERRUPTIBLE. In the -rt patch, this code is commonly called when
PREEMPT_RT is enabled with TASK_UNINTERRUPTIBLE. But that's not the
likely scenario.

The rt_mutex() code should be optimized for the common vanilla case,
and that is from a futex, with TASK_INTERRUPTIBLE as the state.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170119113234.1efeedd1@gandalf.local.home
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-01-30 11:42:59 +01:00
..
2017-01-10 18:31:54 -08:00
2016-12-25 17:21:22 +01:00
2016-12-25 17:21:22 +01:00
2016-11-25 16:25:52 -05:00
2016-12-26 17:30:24 -08:00
2017-01-14 11:14:38 +01:00
2016-12-25 17:21:22 +01:00
2016-08-05 09:00:54 -04:00
2016-12-12 18:55:06 -08:00
2016-02-16 13:04:58 -05:00
2017-01-14 11:37:18 +01:00
2016-03-01 20:36:56 +01:00
2016-12-22 22:58:37 -05:00
2016-09-22 20:00:36 -05:00