diff options
author | Peter Zijlstra <peterz@infradead.org> | 2021-08-26 11:48:18 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2021-08-27 15:28:49 +0300 |
commit | a055fcc132d4c25b96d1115aea514258810dc6fc (patch) | |
tree | 765871f3a38bf75449cc41a0fcd530fa421f2835 /lib | |
parent | 6467822b8cc96e5feda98c7bf5c6329c6a896c91 (diff) | |
download | linux-a055fcc132d4c25b96d1115aea514258810dc6fc.tar.xz |
locking/rtmutex: Return success on deadlock for ww_mutex waiters
ww_mutexes can legitimately cause a deadlock situation in the lock graph
which is resolved afterwards by the wait/wound mechanics. The rtmutex chain
walk can detect such a deadlock and returns EDEADLK which in turn skips the
wait/wound mechanism and returns EDEADLK to the caller. That's wrong
because both lock chains might get EDEADLK or the wrong waiter would back
out.
Detect that situation and return 'success' in case that the waiter which
initiated the chain walk is a ww_mutex with context. This allows the
wait/wound mechanics to resolve the situation according to the rules.
[ tglx: Split it apart and added changelog ]
Reported-by: Sebastian Siewior <bigeasy@linutronix.de>
Fixes: add461325ec5 ("locking/rtmutex: Extend the rtmutex core to support ww_mutex")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/YSeWjCHoK4v5OcOt@hirez.programming.kicks-ass.net
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions