summaryrefslogtreecommitdiff
path: root/kernel/rtmutex-debug.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-07-07 16:56:28 +0200
committerJiri Slaby <jslaby@suse.cz>2014-07-16 11:31:17 +0200
commita2e64fcdc83c645813f7b93e4df291841ba7c625 (patch)
tree4b00a4d16c0fcec35a7eb77833197493e0d619d2 /kernel/rtmutex-debug.h
parent7ae4100dfa6e14122dfe684fd324954ada793d65 (diff)
rtmutex: Handle deadlock detection smarter
commit 3d5c9340d1949733eb37616abd15db36aef9a57c upstream. Even in the case when deadlock detection is not requested by the caller, we can detect deadlocks. Right now the code stops the lock chain walk and keeps the waiter enqueued, even on itself. Silly not to yell when such a scenario is detected and to keep the waiter enqueued. Return -EDEADLK unconditionally and handle it at the call sites. The futex calls return -EDEADLK. The non futex ones dequeue the waiter, throw a warning and put the task into a schedule loop. Tagged for stable as it makes the code more robust. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Brad Mouring <bmouring@ni.com> Link: http://lkml.kernel.org/r/20140605152801.836501969@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'kernel/rtmutex-debug.h')
-rw-r--r--kernel/rtmutex-debug.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/rtmutex-debug.h b/kernel/rtmutex-debug.h
index 14193d596d78..ab29b6a22669 100644
--- a/kernel/rtmutex-debug.h
+++ b/kernel/rtmutex-debug.h
@@ -31,3 +31,8 @@ static inline int debug_rt_mutex_detect_deadlock(struct rt_mutex_waiter *waiter,
{
return (waiter != NULL);
}
+
+static inline void rt_mutex_print_deadlock(struct rt_mutex_waiter *w)
+{
+ debug_rt_mutex_print_deadlock(w);
+}