Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rtmutex: use a trylock for waiter lock in trylock
Mike Galbraith captered the following: | >torvalds#11 [ffff88017b243e90] _raw_spin_lock at ffffffff815d2596 | >torvalds#12 [ffff88017b243e90] rt_mutex_trylock at ffffffff815d15be | >torvalds#13 [ffff88017b243eb0] get_next_timer_interrupt at ffffffff81063b42 | >torvalds#14 [ffff88017b243f00] tick_nohz_stop_sched_tick at ffffffff810bd1fd | >torvalds#15 [ffff88017b243f70] tick_nohz_irq_exit at ffffffff810bd7d2 | >torvalds#16 [ffff88017b243f90] irq_exit at ffffffff8105b02d | >torvalds#17 [ffff88017b243fb0] reschedule_interrupt at ffffffff815db3dd | >--- <IRQ stack> --- | >torvalds#18 [ffff88017a2a9bc8] reschedule_interrupt at ffffffff815db3dd | > [exception RIP: task_blocks_on_rt_mutex+51] | >torvalds#19 [ffff88017a2a9ce0] rt_spin_lock_slowlock at ffffffff815d183c | >torvalds#20 [ffff88017a2a9da0] lock_timer_base.isra.35 at ffffffff81061cbf | >torvalds#21 [ffff88017a2a9dd0] schedule_timeout at ffffffff815cf1ce | >torvalds#22 [ffff88017a2a9e50] rcu_gp_kthread at ffffffff810f9bbb | >torvalds#23 [ffff88017a2a9ed0] kthread at ffffffff810796d5 | >torvalds#24 [ffff88017a2a9f50] ret_from_fork at ffffffff815da04c lock_timer_base() does a try_lock() which deadlocks on the waiter lock not the lock itself. This patch takes the waiter_lock with trylock so it should work from interrupt context as well. If the fastpath doesn't work and the waiter_lock itself is taken then it seems that the lock itself taken. This patch also adds a "rt_spin_try_unlock" to keep lockdep happy. If we managed to take the wait_lock in the first place we should also be able to take it in the unlock path. Cc: [email protected] Reported-by: Mike Galbraith <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
- Loading branch information