kernel-aes67/kernel/locking
Uros Bizjak ce3576ebd6 locking/rtmutex: Use try_cmpxchg_relaxed() in mark_rt_mutex_waiters()
Use try_cmpxchg() instead of cmpxchg(*ptr, old, new) == old.

The x86 CMPXCHG instruction returns success in the ZF flag, so this change
saves a compare after CMPXCHG (and related move instruction in front of CMPXCHG).

Also, try_cmpxchg() implicitly assigns old *ptr value to "old" when CMPXCHG
fails. There is no need to re-read the value in the loop.

Note that the value from *ptr should be read using READ_ONCE() to prevent
the compiler from merging, refetching or reordering the read.

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Waiman Long <longman@redhat.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Link: https://lore.kernel.org/r/20240124104953.612063-1-ubizjak@gmail.com
2024-03-01 13:02:05 +01:00
..
Makefile
irqflag-debug.c
lock_events.c
lock_events.h
lock_events_list.h
lockdep.c lockdep: Fix block chain corruption 2023-11-24 11:04:54 +01:00
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
locktorture.c locktorture: Increase Hamming distance between call_rcu_chain and rcu_call_chains 2023-11-23 11:58:18 +05:30
mcs_spinlock.h
mutex-debug.c
mutex.c locking/mutex: Document that mutex_unlock() is non-atomic 2023-12-01 11:27:43 +01:00
mutex.h
osq_lock.c locking/osq_lock: Clarify osq_wait_next() 2023-12-30 10:25:51 -08:00
percpu-rwsem.c locking/percpu-rwsem: Trigger contention tracepoints only if contended 2024-02-28 13:10:29 +01:00
qrwlock.c
qspinlock.c
qspinlock_paravirt.h locking/qspinlock: Fix 'wait_early' set but not used warning 2024-02-28 13:08:37 +01:00
qspinlock_stat.h
rtmutex.c locking/rtmutex: Use try_cmpxchg_relaxed() in mark_rt_mutex_waiters() 2024-03-01 13:02:05 +01:00
rtmutex_api.c
rtmutex_common.h
rwbase_rt.c
rwsem.c locking/rwsem: Clarify that RWSEM_READER_OWNED is just a hint 2024-02-28 13:08:38 +01:00
semaphore.c
spinlock.c
spinlock_debug.c sched.h: move pid helpers to pid.h 2023-12-20 19:26:31 -05:00
spinlock_rt.c
test-ww_mutex.c
ww_mutex.h
ww_rt_mutex.c