This would likely be better if holding over wakeup is ok. pi-tests still work, as does everything else I've tried. Doesn't _seem_ like a bad idea to keep pending owner on a leash until we're done fiddling with him, but dunno, I've never needed to tinker here. diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c index 23dd443..051f386 100644 --- a/kernel/rtmutex.c +++ b/kernel/rtmutex.c @@ -525,6 +525,9 @@ static void wakeup_next_waiter(struct rt_mutex *lock, int savestate) pendowner = waiter->task; waiter->task = NULL; + raw_spin_unlock(¤t->pi_lock); + raw_spin_lock(&pendowner->pi_lock); + /* * Do the wakeup before the ownership change to give any spinning * waiter grantees a headstart over the other threads that will @@ -562,8 +565,6 @@ static void wakeup_next_waiter(struct rt_mutex *lock, int savestate) rt_mutex_set_owner(lock, pendowner, RT_MUTEX_OWNER_PENDING); - raw_spin_unlock(¤t->pi_lock); - /* * Clear the pi_blocked_on variable and enqueue a possible * waiter into the pi_waiters list of the pending owner. This @@ -577,8 +578,6 @@ static void wakeup_next_waiter(struct rt_mutex *lock, int savestate) else next = NULL; - raw_spin_lock(&pendowner->pi_lock); - WARN_ON(!pendowner->pi_blocked_on); WARN_ON(pendowner->pi_blocked_on != waiter); WARN_ON(pendowner->pi_blocked_on->lock != lock); -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html