Skip to content

Commit 338c847

Browse files
committed
Merge tag 'locking-urgent-2023-02-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fix from Ingo Molnar: "Fix an rtmutex missed-wakeup bug" * tag 'locking-urgent-2023-02-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: rtmutex: Ensure that the top waiter is always woken up
2 parents d12aca5 + db370a8 commit 338c847

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kernel/locking/rtmutex.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,9 @@ static int __sched rt_mutex_adjust_prio_chain(struct task_struct *task,
901901
* then we need to wake the new top waiter up to try
902902
* to get the lock.
903903
*/
904-
if (prerequeue_top_waiter != rt_mutex_top_waiter(lock))
905-
wake_up_state(waiter->task, waiter->wake_state);
904+
top_waiter = rt_mutex_top_waiter(lock);
905+
if (prerequeue_top_waiter != top_waiter)
906+
wake_up_state(top_waiter->task, top_waiter->wake_state);
906907
raw_spin_unlock_irq(&lock->wait_lock);
907908
return 0;
908909
}

0 commit comments

Comments
 (0)