From: Darren Hart on
rtmutex proxy locking complicates the logic a bit and opens up
the possibility for a task to wake and attempt to take another
sleeping lock without knowing it has been enqueued on another
lock already. Add a BUG_ON to catch this scenario early.

Signed-off-by: Darren Hart <dvhltc(a)>
Cc: Thomas Gleixner <tglx(a)>
Cc: Peter Zijlstra <peterz(a)>
Cc: Ingo Molnar <mingo(a)>
Cc: Eric Dumazet <eric.dumazet(a)>
Cc: John Kacur <jkacur(a)>
Cc: Steven Rostedt <rostedt(a)>
Cc: Mike Galbraith <efault(a)>
kernel/rtmutex.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c
index baac7d9..22f9d18 100644
--- a/kernel/rtmutex.c
+++ b/kernel/rtmutex.c
@@ -459,6 +459,9 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
top_waiter = rt_mutex_top_waiter(lock);
plist_add(&waiter->list_entry, &lock->wait_list);

+ /* Tasks can only block on one lock at a time. */
+ BUG_ON(task->pi_blocked_on != NULL);
task->pi_blocked_on = waiter;


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)
More majordomo info at
Please read the FAQ at