From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425892AbcFHOT6 (ORCPT ); Wed, 8 Jun 2016 10:19:58 -0400 Received: from terminus.zytor.com ([198.137.202.10]:34006 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423623AbcFHOTx (ORCPT ); Wed, 8 Jun 2016 10:19:53 -0400 Date: Wed, 8 Jun 2016 07:19:11 -0700 From: tip-bot for Sebastian Andrzej Siewior Message-ID: Cc: bigeasy@linutronix.de, paulmck@linux.vnet.ibm.com, mingo@kernel.org, hpa@zytor.com, akpm@linux-foundation.org, peterz@infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org Reply-To: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, akpm@linux-foundation.org, paulmck@linux.vnet.ibm.com, hpa@zytor.com, mingo@kernel.org, bigeasy@linutronix.de In-Reply-To: <1464356838-1755-1-git-send-email-bigeasy@linutronix.de> References: <1464356838-1755-1-git-send-email-bigeasy@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/rtmutex: Only warn once on a trylock from bad context Git-Commit-ID: a461d58792d4a46b8b10ae50973ec9b2763b694e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a461d58792d4a46b8b10ae50973ec9b2763b694e Gitweb: http://git.kernel.org/tip/a461d58792d4a46b8b10ae50973ec9b2763b694e Author: Sebastian Andrzej Siewior AuthorDate: Fri, 27 May 2016 15:47:18 +0200 Committer: Ingo Molnar CommitDate: Wed, 8 Jun 2016 14:22:00 +0200 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 Signed-off-by: Peter Zijlstra (Intel) Cc: Andrew Morton Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1464356838-1755-1-git-send-email-bigeasy@linutronix.de Signed-off-by: Ingo Molnar --- 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 3e74660..1ec0f48 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);