diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2007-06-08 16:46:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-08 20:23:34 -0400 |
commit | 1a539a87280b3032fd12bc93a4a82f1d8aa97ca8 (patch) | |
tree | 6dea1610ba5ff54f0e3f845d83bfc68ffc162e31 /kernel | |
parent | c0d1d2bf5a28f78def7b68ca1eb5ba31aafd43a1 (diff) |
rt-mutex: fix chain walk early wakeup bug
Alexey Kuznetsov found some problems in the pi-futex code.
One of the root causes is:
When a wakeup happens, we do not to stop the chain walk so we follow a not
longer relevant locking chain.
Drop out when this happens.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: Ulrich Drepper <drepper@redhat.com>
Cc: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rtmutex.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c index a273183c37a..a6fbb413052 100644 --- a/kernel/rtmutex.c +++ b/kernel/rtmutex.c | |||
@@ -189,6 +189,19 @@ int rt_mutex_adjust_prio_chain(struct task_struct *task, | |||
189 | if (!waiter || !waiter->task) | 189 | if (!waiter || !waiter->task) |
190 | goto out_unlock_pi; | 190 | goto out_unlock_pi; |
191 | 191 | ||
192 | /* | ||
193 | * Check the orig_waiter state. After we dropped the locks, | ||
194 | * the previous owner of the lock might have released the lock | ||
195 | * and made us the pending owner: | ||
196 | */ | ||
197 | if (orig_waiter && !orig_waiter->task) | ||
198 | goto out_unlock_pi; | ||
199 | |||
200 | /* | ||
201 | * Drop out, when the task has no waiters. Note, | ||
202 | * top_waiter can be NULL, when we are in the deboosting | ||
203 | * mode! | ||
204 | */ | ||
192 | if (top_waiter && (!task_has_pi_waiters(task) || | 205 | if (top_waiter && (!task_has_pi_waiters(task) || |
193 | top_waiter != task_top_pi_waiter(task))) | 206 | top_waiter != task_top_pi_waiter(task))) |
194 | goto out_unlock_pi; | 207 | goto out_unlock_pi; |