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.

rqspinlock: Add rqspinlock.h header

This header contains the public declarations usable in the rest of the
kernel for rqspinlock.

Let's also type alias qspinlock to rqspinlock_t to ensure consistent use
of the new lock type. We want to remove dependence on the qspinlock type
in later patches as we need to provide a test-and-set fallback, hence
begin abstracting away from now onwards.

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

authored by

Kumar Kartikeya Dwivedi and committed by
Alexei Starovoitov
30ff1332 a8fcf2a3

+21 -1
+19
include/asm-generic/rqspinlock.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + /* 3 + * Resilient Queued Spin Lock 4 + * 5 + * (C) Copyright 2024-2025 Meta Platforms, Inc. and affiliates. 6 + * 7 + * Authors: Kumar Kartikeya Dwivedi <memxor@gmail.com> 8 + */ 9 + #ifndef __ASM_GENERIC_RQSPINLOCK_H 10 + #define __ASM_GENERIC_RQSPINLOCK_H 11 + 12 + #include <linux/types.h> 13 + 14 + struct qspinlock; 15 + typedef struct qspinlock rqspinlock_t; 16 + 17 + extern void resilient_queued_spin_lock_slowpath(rqspinlock_t *lock, u32 val); 18 + 19 + #endif /* __ASM_GENERIC_RQSPINLOCK_H */
+2 -1
kernel/bpf/rqspinlock.c
··· 23 23 #include <asm/byteorder.h> 24 24 #include <asm/qspinlock.h> 25 25 #include <trace/events/lock.h> 26 + #include <asm/rqspinlock.h> 26 27 27 28 /* 28 29 * Include queued spinlock definitions and statistics code ··· 128 127 * contended : (*,x,y) +--> (*,0,0) ---> (*,0,1) -' : 129 128 * queue : ^--' : 130 129 */ 131 - void __lockfunc resilient_queued_spin_lock_slowpath(struct qspinlock *lock, u32 val) 130 + void __lockfunc resilient_queued_spin_lock_slowpath(rqspinlock_t *lock, u32 val) 132 131 { 133 132 struct mcs_spinlock *prev, *next, *node; 134 133 u32 old, tail;