Skip to content

Commit a461d58

Browse files
Sebastian Andrzej SiewiorIngo Molnar
authored andcommitted
locking/rtmutex: Only warn once on a trylock from bad context
One warning should be enough to get one motivated to fix this. It is possible that this happens more than once and that starts flooding the output. Later the prints will be suppressed so we only get half of it. Depending on the console system used it might not be helpful. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1464356838-1755-1-git-send-email-bigeasy@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent dfaaf3f commit a461d58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/locking/rtmutex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ EXPORT_SYMBOL_GPL(rt_mutex_timed_lock);
14781478
*/
14791479
int __sched rt_mutex_trylock(struct rt_mutex *lock)
14801480
{
1481-
if (WARN_ON(in_irq() || in_nmi() || in_serving_softirq()))
1481+
if (WARN_ON_ONCE(in_irq() || in_nmi() || in_serving_softirq()))
14821482
return 0;
14831483

14841484
return rt_mutex_fasttrylock(lock, rt_mutex_slowtrylock);

0 commit comments

Comments
 (0)