Commit 4a07791
locking/rtmutex: Make sure we wake anything on the wake_q when we release the lock->wait_lock
Bert reported seeing occasional boot hangs when running with
PREEPT_RT and bisected it down to commit 894d1b3
("locking/mutex: Remove wakeups from under mutex::wait_lock").
It looks like I missed a few spots where we drop the wait_lock and
potentially call into schedule without waking up the tasks on the
wake_q structure. Since the tasks being woken are ww_mutex tasks
they need to be able to run to release the mutex and unblock the
task that currently is planning to wake them. Thus we can deadlock.
So make sure we wake the wake_q tasks when we unlock the wait_lock.
Closes: https://lore.kernel.org/lkml/[email protected]
Fixes: 894d1b3 ("locking/mutex: Remove wakeups from under mutex::wait_lock")
Reported-by: Bert Karwatzki <[email protected]>
Signed-off-by: John Stultz <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]1 parent 78d4f34 commit 4a07791
2 files changed
+17
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1292 | 1292 | | |
1293 | 1293 | | |
1294 | 1294 | | |
| 1295 | + | |
1295 | 1296 | | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
1296 | 1302 | | |
1297 | 1303 | | |
1298 | 1304 | | |
| |||
1596 | 1602 | | |
1597 | 1603 | | |
1598 | 1604 | | |
| 1605 | + | |
1599 | 1606 | | |
1600 | 1607 | | |
1601 | 1608 | | |
1602 | 1609 | | |
1603 | 1610 | | |
1604 | 1611 | | |
1605 | 1612 | | |
1606 | | - | |
| 1613 | + | |
| 1614 | + | |
1607 | 1615 | | |
1608 | 1616 | | |
1609 | 1617 | | |
| |||
1634 | 1642 | | |
1635 | 1643 | | |
1636 | 1644 | | |
| 1645 | + | |
1637 | 1646 | | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
1638 | 1652 | | |
1639 | 1653 | | |
1640 | 1654 | | |
| |||
1708 | 1722 | | |
1709 | 1723 | | |
1710 | 1724 | | |
1711 | | - | |
| 1725 | + | |
1712 | 1726 | | |
1713 | 1727 | | |
1714 | 1728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
| 386 | + | |
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| |||
0 commit comments