linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel/rtmutex: only warn once on a try lock from bad context
@ 2016-05-27 13:47 Sebastian Andrzej Siewior
  2016-06-03 10:58 ` [tip:locking/core] locking/rtmutex: Only warn once on a trylock " tip-bot for Sebastian Andrzej Siewior
  2016-06-08 14:19 ` tip-bot for Sebastian Andrzej Siewior
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2016-05-27 13:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Peter Zijlstra, Ingo Molnar, tglx, Sebastian Andrzej Siewior

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 <bigeasy@linutronix.de>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [tip:locking/core] locking/rtmutex: Only warn once on a trylock from bad context
  2016-05-27 13:47 [PATCH] kernel/rtmutex: only warn once on a try lock from bad context Sebastian Andrzej Siewior
@ 2016-06-03 10:58 ` tip-bot for Sebastian Andrzej Siewior
  2016-06-08 14:19 ` tip-bot for Sebastian Andrzej Siewior
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Sebastian Andrzej Siewior @ 2016-06-03 10:58 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: akpm, torvalds, mingo, peterz, paulmck, linux-kernel, tglx, bigeasy, hpa

Commit-ID:  17544d7dc82bc0ce43ba7e3f12d37c6a2337dc01
Gitweb:     http://git.kernel.org/tip/17544d7dc82bc0ce43ba7e3f12d37c6a2337dc01
Author:     Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate: Fri, 27 May 2016 15:47:18 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 3 Jun 2016 12:06:12 +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 <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>
---
 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);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [tip:locking/core] locking/rtmutex: Only warn once on a trylock from bad context
  2016-05-27 13:47 [PATCH] kernel/rtmutex: only warn once on a try lock from bad context Sebastian Andrzej Siewior
  2016-06-03 10:58 ` [tip:locking/core] locking/rtmutex: Only warn once on a trylock " tip-bot for Sebastian Andrzej Siewior
@ 2016-06-08 14:19 ` tip-bot for Sebastian Andrzej Siewior
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Sebastian Andrzej Siewior @ 2016-06-08 14:19 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: bigeasy, paulmck, mingo, hpa, akpm, peterz, linux-kernel, tglx, torvalds

Commit-ID:  a461d58792d4a46b8b10ae50973ec9b2763b694e
Gitweb:     http://git.kernel.org/tip/a461d58792d4a46b8b10ae50973ec9b2763b694e
Author:     Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate: Fri, 27 May 2016 15:47:18 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
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 <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>
---
 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);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-08 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-27 13:47 [PATCH] kernel/rtmutex: only warn once on a try lock from bad context Sebastian Andrzej Siewior
2016-06-03 10:58 ` [tip:locking/core] locking/rtmutex: Only warn once on a trylock " tip-bot for Sebastian Andrzej Siewior
2016-06-08 14:19 ` tip-bot for Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).