android_kernel_msm-6.1_noth.../kernel/locking
xieliujie 57750518de ANDROID: vendor_hook: Avoid clearing protect-flag before waking waiters
With hooks below, we can mark a lock-owned thread with an identifiable flag, which can protect it from being preempted by some other unimportant threads, and then waiter will be wakeup more quickly.
https://android-review.googlesource.com/c/kernel/common/+/2183353

but now we find an issue like this one:
static inline void __up_write(struct rw_semaphore *sem)
{
        ...
        // Step 1. we clear flag.
        trace_android_vh_record_rwsem_lock_starttime(current, 0);
        // Step 2. owner may be preempted by unimportant threads.
        rwsem_clear_owner(sem);
        ...
        // Step 3. wake up waiter, but it's too later.
        if (unlikely(tmp & RWSEM_FLAG_WAITERS))
                rwsem_wake(sem);
}

This patch will clear protect-flag after waking up waiters.

Bug: 286024926
Change-Id: I71f8b6a7d8a01336fd36b8267c2cb5edab65bd11
Signed-off-by: xieliujie <xieliujie@oppo.com>
2023-06-07 21:34:17 +00:00
..
irqflag-debug.c
lock_events.c
lock_events.h
lock_events_list.h
lockdep.c cpuidle: lib/bug: Disable rcu_is_watching() during WARN/BUG 2023-03-10 09:33:47 +01:00
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
locktorture.c
Makefile kmsan: disable instrumentation of unsupported common kernel code 2022-10-03 14:03:20 -07:00
mcs_spinlock.h
mutex-debug.c
mutex.c ANDROID: vendor_hook: Avoid clearing protect-flag before waking waiters 2023-06-07 21:34:17 +00:00
mutex.h
osq_lock.c
percpu-rwsem.c ANDROID: vendor_hook: Avoid clearing protect-flag before waking waiters 2023-06-07 21:34:17 +00:00
qrwlock.c
qspinlock.c
qspinlock_paravirt.h
qspinlock_stat.h
rtmutex.c ANDROID: Re-apply vendor hooks for information of blocked tasks 2023-03-10 18:16:02 +00:00
rtmutex_api.c ANDROID: vendor_hook: add hooks to protect locking-tsk in cpu scheduler 2023-05-05 19:45:34 +00:00
rtmutex_common.h
rwbase_rt.c
rwsem.c ANDROID: vendor_hook: Avoid clearing protect-flag before waking waiters 2023-06-07 21:34:17 +00:00
semaphore.c locking: Add __sched to semaphore functions 2022-09-15 16:14:03 +02:00
spinlock.c
spinlock_debug.c
spinlock_rt.c
test-ww_mutex.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
ww_mutex.h
ww_rt_mutex.c