locking/rtmutex: Restrict the trylock WARN_ON() to debug
authorThomas Gleixner <tglx@linutronix.de>
Fri, 26 Mar 2021 15:29:43 +0000 (16:29 +0100)
committerIngo Molnar <mingo@kernel.org>
Mon, 29 Mar 2021 13:57:04 +0000 (15:57 +0200)
commitc2c360ed7f28fd6b7eb7e39e70af2d2ae405f466
tree0850b7991410c54c110d923f274ef7f2ab908fb3
parent82cd5b1039e26b1b1254886464991e34de439ac5
locking/rtmutex: Restrict the trylock WARN_ON() to debug

The warning as written is expensive and not really required for a
production kernel. Make it depend on rt mutex debugging and use !in_task()
for the condition which generates far better code and gives the same
answer.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210326153944.436565064@linutronix.de
kernel/locking/rtmutex.c