linux-bl808/kernel/locking
Waiman Long 54c1ee4d61 locking/rwsem: Conditionally wake waiters in reader/writer slowpaths
In an analysis of a recent vmcore, a reader-owned rwsem was found with
385 readers but no writer in the wait queue. That is kind of unusual
but it may be caused by some race conditions that we have not fully
understood yet. In such a case, all the readers in the wait queue should
join the other reader-owners and acquire the read lock.

In rwsem_down_write_slowpath(), an incoming writer will try to
wake up the front readers under such circumstance. That is not
the case for rwsem_down_read_slowpath(), add a new helper function
rwsem_cond_wake_waiter() to do wakeup and use it in both reader and
writer slowpaths to have a consistent and correct behavior.

Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20220322152059.2182333-3-longman@redhat.com
2022-04-05 10:24:35 +02:00
..
irqflag-debug.c
lock_events.c
lock_events.h
lock_events_list.h
lockdep.c lockdep: Fix -Wunused-parameter for _THIS_IP_ 2022-04-05 10:24:34 +02:00
lockdep_internals.h locking/lockdep: Iterate lock_classes directly when reading lockdep files 2022-02-16 15:57:58 +01:00
lockdep_proc.c locking/lockdep: Iterate lock_classes directly when reading lockdep files 2022-02-16 15:57:58 +01:00
lockdep_states.h
locktorture.c locktorture,rcutorture,torture: Always log error message 2021-12-07 16:36:17 -08:00
Makefile
mcs_spinlock.h
mutex-debug.c
mutex.c locking: Make owner_on_cpu() into <linux/sched.h> 2021-12-04 10:56:25 +01:00
mutex.h
osq_lock.c
percpu-rwsem.c locking: Add missing __sched attributes 2022-02-11 12:13:55 +01:00
qrwlock.c
qspinlock.c
qspinlock_paravirt.h
qspinlock_stat.h
rtmutex.c Merge branch 'locking/urgent' into locking/core 2021-12-18 10:57:03 +01:00
rtmutex_api.c locking/rtmutex: Add rt_mutex_lock_nest_lock() and rt_mutex_lock_killable(). 2021-12-04 10:56:23 +01:00
rtmutex_common.h
rwbase_rt.c locking/rwbase: Optimize rwbase_read_trylock 2021-10-07 13:51:07 +02:00
rwsem.c locking/rwsem: Conditionally wake waiters in reader/writer slowpaths 2022-04-05 10:24:35 +02:00
semaphore.c
spinlock.c locking/rwlocks: introduce write_lock_nested 2022-01-22 08:33:37 +02:00
spinlock_debug.c
spinlock_rt.c locking/rwlocks: introduce write_lock_nested 2022-01-22 08:33:37 +02:00
test-ww_mutex.c locking/ww-mutex: Fix uninitialized use of ret in test_aa() 2021-10-01 13:57:49 +02:00
ww_mutex.h
ww_rt_mutex.c kernel/locking: Use a pointer in ww_mutex_trylock(). 2021-11-17 14:48:49 +01:00