lkml.org 
[lkml]   [2009]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/2][RT] Avoid deadlock in rt_mutex_start_proxy_lock()
In the event of a lock steal or owner died, rt_mutex_start_proxy_lock() will
give the rt_mutex to the waiting task, but it fails to release the wait_lock.
This leads to subsequent deadlocks when other tasks try to acquire the
rt_mutex.

I also removed a few extra blank lines that really spaced this routine out.
I must have been high on the \n when I wrote this originally...

Note: this is the -rt version, I'll send another for mainline.

Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
CC: Dinakar Guniguntala <dino@in.ibm.com>
CC: John Stultz <johnstul@us.ibm.com>
CC: John Kacur <jkacur@redhat.com>

Index: 2.6.31-rc4-rt1/kernel/rtmutex.c
===================================================================
--- 2.6.31-rc4-rt1.orig/kernel/rtmutex.c 2009-08-05 10:29:39.000000000 -0700
+++ 2.6.31-rc4-rt1/kernel/rtmutex.c 2009-08-05 11:10:22.000000000 -0700
@@ -1517,9 +1517,8 @@ int rt_mutex_start_proxy_lock(struct rt_
try_to_steal_lock(lock, task, STEAL_NORMAL)) {
/* We got the lock for task. */
debug_rt_mutex_lock(lock);
-
rt_mutex_set_owner(lock, task, 0);
-
+ atomic_spin_unlock_irqrestore(&lock->wait_lock, flags);
rt_mutex_deadlock_account_lock(lock, task);
return 1;
}
@@ -1527,7 +1526,6 @@ int rt_mutex_start_proxy_lock(struct rt_
ret = task_blocks_on_rt_mutex(lock, waiter, task, detect_deadlock,
flags);

-
if (ret && !waiter->task) {
/*
* Reset the return value. We might have
--
Darren Hart
IBM Linux Technology Center
Real-Time Linux Team


\
 
 \ /
  Last update: 2009-08-06 00:07    [W:0.092 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site