linux-stable/kernel/locking
Zqiang b31395e0d1 locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal
[ Upstream commit 3a010c4932 ]

When a interruptible mutex locker is interrupted by a signal
without acquiring this lock and removed from the wait queue.
if the mutex isn't contended enough to have a waiter
put into the wait queue again, the setting of the WAITER
bit will force mutex locker to go into the slowpath to
acquire the lock every time, so if the wait queue is empty,
the WAITER bit need to be clear.

Fixes: 040a0a3710 ("mutex: Add support for wound/wait style locks")
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Zqiang <qiang.zhang@windriver.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210517034005.30828-1-qiang.zhang@windriver.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-26 11:48:32 +02:00
..
lockdep.c lockdep: Add a missing initialization hint to the "INFO: Trying to register non-static key" message 2021-04-28 13:16:48 +02:00
lockdep_internals.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lockdep_proc.c locking/lockdep: Fix overflow in presentation of average lock-time 2020-09-03 11:24:21 +02:00
lockdep_states.h locking/lockdep: Rework FS_RECLAIM annotation 2017-08-10 12:29:03 +02:00
locktorture.c locktorture: Print ratio of acquisitions, not failures 2020-04-23 10:30:23 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mcs_spinlock.h locking/mcs: Use smp_cond_load_acquire() in MCS spin loop 2018-04-27 09:48:49 +02:00
mutex-debug.c locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal 2021-05-26 11:48:32 +02:00
mutex-debug.h locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal 2021-05-26 11:48:32 +02:00
mutex.c locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal 2021-05-26 11:48:32 +02:00
mutex.h locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal 2021-05-26 11:48:32 +02:00
osq_lock.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
percpu-rwsem.c
qrwlock.c locking/qrwlock: Fix ordering in queued_write_lock_slowpath() 2021-04-28 13:16:52 +02:00
qspinlock.c locking/qspinlock, x86: Provide liveness guarantee 2018-12-21 14:15:12 +01:00
qspinlock_paravirt.h Revert "locking/pvqspinlock: Don't wait if vCPU is preempted" 2019-10-11 18:21:06 +02:00
qspinlock_stat.h locking/qspinlock: Add stat tracking for pending vs. slowpath 2018-04-27 09:48:53 +02:00
rtmutex-debug.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rtmutex-debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rtmutex.c rtmutex: Remove unused argument from rt_mutex_proxy_unlock() 2021-01-30 13:32:12 +01:00
rtmutex.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rtmutex_common.h rtmutex: Remove unused argument from rt_mutex_proxy_unlock() 2021-01-30 13:32:12 +01:00
rwsem-spinlock.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rwsem-xadd.c locking/rwsem: Prevent decrement of reader count before increment 2019-05-22 07:37:34 +02:00
rwsem.c locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS 2018-06-20 11:29:23 +02:00
rwsem.h locking/rwsem: Add a new RWSEM_ANONYMOUSLY_OWNED flag 2018-05-16 11:45:15 +02:00
semaphore.c
spinlock.c locking/core: Remove break_lock field when CONFIG_GENERIC_LOCKBREAK=y 2017-12-12 11:24:01 +01:00
spinlock_debug.c locking/spinlock/debug: Fix various data races 2020-01-12 12:17:05 +01:00
test-ww_mutex.c locking/ww_mutex: Fix runtime warning in the WW mutex selftest 2018-10-03 08:56:31 +02:00