From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755126AbcE0Nr2 (ORCPT ); Fri, 27 May 2016 09:47:28 -0400 Received: from www.linutronix.de ([62.245.132.108]:47278 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755089AbcE0Nr0 (ORCPT ); Fri, 27 May 2016 09:47:26 -0400 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Ingo Molnar , tglx@linutronix.de, Sebastian Andrzej Siewior Subject: [PATCH] kernel/rtmutex: only warn once on a try lock from bad context Date: Fri, 27 May 2016 15:47:18 +0200 Message-Id: <1464356838-1755-1-git-send-email-bigeasy@linutronix.de> X-Mailer: git-send-email 2.8.1 X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org One warning should be enough to get one motivated to fix this. It is possible that this happens more than once and so 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 helpfull. Signed-off-by: Sebastian Andrzej Siewior --- kernel/locking/rtmutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index 3e746607abe5..1ec0f48962b3 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -1478,7 +1478,7 @@ EXPORT_SYMBOL_GPL(rt_mutex_timed_lock); */ int __sched rt_mutex_trylock(struct rt_mutex *lock) { - if (WARN_ON(in_irq() || in_nmi() || in_serving_softirq())) + if (WARN_ON_ONCE(in_irq() || in_nmi() || in_serving_softirq())) return 0; return rt_mutex_fasttrylock(lock, rt_mutex_slowtrylock); -- 2.8.1