diff options
author | Thomas Gleixner <[email protected]> | 2014-06-05 12:34:23 +0200 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2014-06-07 14:55:40 +0200 |
commit | 3d5c9340d1949733eb37616abd15db36aef9a57c (patch) | |
tree | 257ce62564f206a530ba6b0aedf732a2dee0b6d2 /kernel/locking/rtmutex-debug.h | |
parent | 951e273060d15b233a7f7ccaf76ba682b5b05a03 (diff) |
rtmutex: Handle deadlock detection smarter
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 <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Brad Mouring <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Cc: [email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
Diffstat (limited to 'kernel/locking/rtmutex-debug.h')
-rw-r--r-- | kernel/locking/rtmutex-debug.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/locking/rtmutex-debug.h b/kernel/locking/rtmutex-debug.h index 14193d596d78..ab29b6a22669 100644 --- a/kernel/locking/rtmutex-debug.h +++ b/kernel/locking/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); +} |