* [PATCH for-next v1] locking: Add __percpu tag to decode_tail qnode argument
@ 2025-03-19 13:35 Kumar Kartikeya Dwivedi
2025-03-19 15:06 ` Alexei Starovoitov
0 siblings, 1 reply; 2+ messages in thread
From: Kumar Kartikeya Dwivedi @ 2025-03-19 13:35 UTC (permalink / raw)
To: bpf
Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
Martin KaFai Lau, Eduard Zingerman, kkd, kernel-team
The decode_tail function now takes a qnode argument to use distinct
qnodes for qspinlock and rqspinlock. Add a __percpu tag to avoid
warnings and errors and reflect that the qnodes are per-cpu. There
is no actual bug here as the value was not dereferenced directly and
passed to per_cpu_ptr, so this is just to suppress the warning/errors
at compile time.
Fixes: 06988910ee2d ("locking: Move common qspinlock helpers to a private header")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
---
kernel/locking/qspinlock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/locking/qspinlock.h b/kernel/locking/qspinlock.h
index d4ceb9490365..f63b6e04ddd4 100644
--- a/kernel/locking/qspinlock.h
+++ b/kernel/locking/qspinlock.h
@@ -59,7 +59,7 @@ static inline __pure u32 encode_tail(int cpu, int idx)
return tail;
}
-static inline __pure struct mcs_spinlock *decode_tail(u32 tail, struct qnode *qnodes)
+static inline __pure struct mcs_spinlock *decode_tail(u32 tail, struct qnode __percpu *qnodes)
{
int cpu = (tail >> _Q_TAIL_CPU_OFFSET) - 1;
int idx = (tail & _Q_TAIL_IDX_MASK) >> _Q_TAIL_IDX_OFFSET;
--
2.47.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH for-next v1] locking: Add __percpu tag to decode_tail qnode argument
2025-03-19 13:35 [PATCH for-next v1] locking: Add __percpu tag to decode_tail qnode argument Kumar Kartikeya Dwivedi
@ 2025-03-19 15:06 ` Alexei Starovoitov
0 siblings, 0 replies; 2+ messages in thread
From: Alexei Starovoitov @ 2025-03-19 15:06 UTC (permalink / raw)
To: Kumar Kartikeya Dwivedi
Cc: bpf, Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
Martin KaFai Lau, Eduard Zingerman, kkd, Kernel Team
On Wed, Mar 19, 2025 at 6:35 AM Kumar Kartikeya Dwivedi
<memxor@gmail.com> wrote:
>
> The decode_tail function now takes a qnode argument to use distinct
> qnodes for qspinlock and rqspinlock. Add a __percpu tag to avoid
> warnings and errors and reflect that the qnodes are per-cpu. There
> is no actual bug here as the value was not dereferenced directly and
> passed to per_cpu_ptr, so this is just to suppress the warning/errors
> at compile time.
>
> Fixes: 06988910ee2d ("locking: Move common qspinlock helpers to a private header")
> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
> ---
> kernel/locking/qspinlock.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/locking/qspinlock.h b/kernel/locking/qspinlock.h
> index d4ceb9490365..f63b6e04ddd4 100644
> --- a/kernel/locking/qspinlock.h
> +++ b/kernel/locking/qspinlock.h
> @@ -59,7 +59,7 @@ static inline __pure u32 encode_tail(int cpu, int idx)
> return tail;
> }
>
> -static inline __pure struct mcs_spinlock *decode_tail(u32 tail, struct qnode *qnodes)
> +static inline __pure struct mcs_spinlock *decode_tail(u32 tail, struct qnode __percpu *qnodes)
Applied. Decided to squash it in and adjusted to
new line to make it shorter.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-19 15:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-19 13:35 [PATCH for-next v1] locking: Add __percpu tag to decode_tail qnode argument Kumar Kartikeya Dwivedi
2025-03-19 15:06 ` Alexei Starovoitov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.