Skip to content

Commit c0149a0

Browse files
kkdwivediAlexei Starovoitov
authored andcommitted
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>
1 parent ac08f68 commit c0149a0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

kernel/locking/mcs_spinlock.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
* spinning, and smp_cond_load_acquire() provides that behavior.
2525
*/
2626
#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)
3028
#endif
3129

3230
#ifndef arch_mcs_spin_unlock_contended

0 commit comments

Comments
 (0)