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

locking: Move MCS struct definition to public header

Move the definition of the struct mcs_spinlock from the private
mcs_spinlock.h header in kernel/locking to the mcs_spinlock.h
asm-generic header, since we will need to reference it from the
qspinlock.h header in subsequent commits.

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

authored by

Kumar Kartikeya Dwivedi and committed by
Alexei Starovoitov
8707d1ee ae0a457f

+6 -6
+6
include/asm-generic/mcs_spinlock.h
··· 1 1 #ifndef __ASM_MCS_SPINLOCK_H 2 2 #define __ASM_MCS_SPINLOCK_H 3 3 4 + struct mcs_spinlock { 5 + struct mcs_spinlock *next; 6 + int locked; /* 1 if lock acquired */ 7 + int count; /* nesting count, see qspinlock.c */ 8 + }; 9 + 4 10 /* 5 11 * Architectures can define their own: 6 12 *
-6
kernel/locking/mcs_spinlock.h
··· 15 15 16 16 #include <asm/mcs_spinlock.h> 17 17 18 - struct mcs_spinlock { 19 - struct mcs_spinlock *next; 20 - int locked; /* 1 if lock acquired */ 21 - int count; /* nesting count, see qspinlock.c */ 22 - }; 23 - 24 18 #ifndef arch_mcs_spin_lock_contended 25 19 /* 26 20 * Using smp_cond_load_acquire() provides the acquire semantics