summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/cs-trace-disasm.py
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-08-02 21:46:20 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-10 17:39:42 +0200
commit6ef8ca1e4f08745b1e56b289bf418474becc937b (patch)
treec6c13539942d36ee202c955e5d35bb9a26f9dd72 /tools/perf/scripts/python/cs-trace-disasm.py
parent1f705af703b314e969264de54f3bcdfffabf2cf5 (diff)
rtmutex: Make wait_lock irq safe
[ Upstream commit b4abf91047cf054f203dcfac97e1038388826937 ] Sasha reported a lockdep splat about a potential deadlock between RCU boosting rtmutex and the posix timer it_lock. CPU0 CPU1 rtmutex_lock(&rcu->rt_mutex) spin_lock(&rcu->rt_mutex.wait_lock) local_irq_disable() spin_lock(&timer->it_lock) spin_lock(&rcu->mutex.wait_lock) --> Interrupt spin_lock(&timer->it_lock) This is caused by the following code sequence on CPU1 rcu_read_lock() x = lookup(); if (x) spin_lock_irqsave(&x->it_lock); rcu_read_unlock(); return x; We could fix that in the posix timer code by keeping rcu read locked across the spinlocked and irq disabled section, but the above sequence is common and there is no reason not to support it. Taking rt_mutex.wait_lock irq safe prevents the deadlock. Reported-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Acked-by: Joe Korty <joe.korty@concurrent-rt.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/cs-trace-disasm.py')
0 files changed, 0 insertions, 0 deletions