Skip to content

Commit def34ea

Browse files
Mike GalbraithKAGA-KOKO
authored andcommitted
rtmutex: Plug preempt count leak in rt_mutex_futex_unlock()
mark_wakeup_next_waiter() already disables preemption, doing so again leaves us with an unpaired preempt_disable(). Fixes: 2a1c602 ("rtmutex: Deboost before waking up the top waiter") Signed-off-by: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: xlpang@redhat.com Cc: rostedt@goodmis.org Link: http://lkml.kernel.org/r/1491379707.6538.2.camel@gmx.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 19830e5 commit def34ea

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎kernel/locking/rtmutex.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,13 +1581,13 @@ bool __sched __rt_mutex_futex_unlock(struct rt_mutex *lock,
15811581
return false; /* done */
15821582
}
15831583

1584-
mark_wakeup_next_waiter(wake_q, lock);
15851584
/*
1586-
* We've already deboosted, retain preempt_disabled when dropping
1587-
* the wait_lock to avoid inversion until the wakeup. Matched
1588-
* by rt_mutex_postunlock();
1585+
* We've already deboosted, mark_wakeup_next_waiter() will
1586+
* retain preempt_disabled when we drop the wait_lock, to
1587+
* avoid inversion prior to the wakeup. preempt_disable()
1588+
* therein pairs with rt_mutex_postunlock().
15891589
*/
1590-
preempt_disable();
1590+
mark_wakeup_next_waiter(wake_q, lock);
15911591

15921592
return true; /* call postunlock() */
15931593
}

0 commit comments

Comments
 (0)