All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
To: bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <martin.lau@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	kkd@meta.com, kernel-team@meta.com
Subject: [PATCH for-next v1] locking: Add __percpu tag to decode_tail qnode argument
Date: Wed, 19 Mar 2025 06:35:23 -0700	[thread overview]
Message-ID: <20250319133523.641009-1-memxor@gmail.com> (raw)

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


             reply	other threads:[~2025-03-19 13:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19 13:35 Kumar Kartikeya Dwivedi [this message]
2025-03-19 15:06 ` [PATCH for-next v1] locking: Add __percpu tag to decode_tail qnode argument Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250319133523.641009-1-memxor@gmail.com \
    --to=memxor@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=kkd@meta.com \
    --cc=martin.lau@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.