diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-05-21 23:25:47 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-06-21 16:05:30 -0400 |
commit | 8930ed80f970a90a795239e7415c9b0e6f964649 (patch) | |
tree | 10463885f150543faaaf621e7ff85bbe6a81c911 /kernel/locking/rtmutex-debug.c | |
parent | c051b21f71d1ffdfd7ad406a1ef5ede5e5f974c5 (diff) |
rtmutex: Cleanup deadlock detector debug logic
The conditions under which deadlock detection is conducted are unclear
and undocumented.
Add constants instead of using 0/1 and provide a selection function
which hides the additional debug dependency from the calling code.
Add comments where needed.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Link: http://lkml.kernel.org/r/20140522031949.947264874@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/locking/rtmutex-debug.c')
-rw-r--r-- | kernel/locking/rtmutex-debug.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/locking/rtmutex-debug.c b/kernel/locking/rtmutex-debug.c index 49b2ed3dced8..62b6cee8ea7f 100644 --- a/kernel/locking/rtmutex-debug.c +++ b/kernel/locking/rtmutex-debug.c | |||
@@ -66,12 +66,13 @@ void rt_mutex_debug_task_free(struct task_struct *task) | |||
66 | * the deadlock. We print when we return. act_waiter can be NULL in | 66 | * the deadlock. We print when we return. act_waiter can be NULL in |
67 | * case of a remove waiter operation. | 67 | * case of a remove waiter operation. |
68 | */ | 68 | */ |
69 | void debug_rt_mutex_deadlock(int detect, struct rt_mutex_waiter *act_waiter, | 69 | void debug_rt_mutex_deadlock(enum rtmutex_chainwalk chwalk, |
70 | struct rt_mutex_waiter *act_waiter, | ||
70 | struct rt_mutex *lock) | 71 | struct rt_mutex *lock) |
71 | { | 72 | { |
72 | struct task_struct *task; | 73 | struct task_struct *task; |
73 | 74 | ||
74 | if (!debug_locks || detect || !act_waiter) | 75 | if (!debug_locks || chwalk == RT_MUTEX_FULL_CHAINWALK || !act_waiter) |
75 | return; | 76 | return; |
76 | 77 | ||
77 | task = rt_mutex_owner(act_waiter->lock); | 78 | task = rt_mutex_owner(act_waiter->lock); |