diff options
author | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2025-03-16 07:05:19 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2025-03-19 18:03:04 +0300 |
commit | c0149a034540ed24de0581a09983710c88253697 (patch) | |
tree | 6c0bab1999de6fd4613f33296790ebc843a9391c | |
parent | ac08f68f1fe32326fbe60a02f9ff5f6749a35ab8 (diff) | |
download | linux-c0149a034540ed24de0581a09983710c88253697.tar.xz |
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>
-rw-r--r-- | kernel/locking/mcs_spinlock.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/locking/mcs_spinlock.h b/kernel/locking/mcs_spinlock.h index 16160ca8907f..5c92ba199b90 100644 --- a/kernel/locking/mcs_spinlock.h +++ b/kernel/locking/mcs_spinlock.h @@ -24,9 +24,7 @@ * spinning, and smp_cond_load_acquire() provides that behavior. */ #define arch_mcs_spin_lock_contended(l) \ -do { \ - smp_cond_load_acquire(l, VAL); \ -} while (0) + smp_cond_load_acquire(l, VAL) #endif #ifndef arch_mcs_spin_unlock_contended |