Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

locking: Allow obtaining result of arch_mcs_spin_lock_contended

To support upcoming changes that require inspecting the return value
once the conditional waiting loop in arch_mcs_spin_lock_contended
terminates, modify the macro to preserve the result of
smp_cond_load_acquire. This enables checking the return value as needed,
which will help disambiguate the MCS node’s locked state in future
patches.

Reviewed-by: Barret Rhoden <brho@google.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20250316040541.108729-4-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Kumar Kartikeya Dwivedi and committed by
Alexei Starovoitov
c0149a03 ac08f68f

+1 -3
+1 -3
kernel/locking/mcs_spinlock.h
··· 24 24 * spinning, and smp_cond_load_acquire() provides that behavior. 25 25 */ 26 26 #define arch_mcs_spin_lock_contended(l) \ 27 - do { \ 28 - smp_cond_load_acquire(l, VAL); \ 29 - } while (0) 27 + smp_cond_load_acquire(l, VAL) 30 28 #endif 31 29 32 30 #ifndef arch_mcs_spin_unlock_contended