From: Zqiang <qiang.zhang@linux.dev>
To: paulmck@kernel.org, frederic@kernel.org,
neeraj.upadhyay@kernel.org, joelagnelf@nvidia.com
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, qiang.zhang@linux.dev
Subject: [PATCH] rcu-tasks: Remove unnecessary smp_store operations in the cblist_init_generic()
Date: Sun, 14 Dec 2025 10:49:04 +0800 [thread overview]
Message-ID: <20251214024904.121128-1-qiang.zhang@linux.dev> (raw)
The cblist_init_generic() is executed during the CPU early boot
phase due to commit:30ef09635b9e ("rcu-tasks: Initialize callback
lists at rcu_init() time"), at this time, only one boot CPU is
online. this commit therefore use WRITE_ONCE() to replace the
smp_store_release() to assigning rtp->percpu_enqueue_lim in the
cblist_init_generic().
Signed-off-by: Zqiang <qiang.zhang@linux.dev>
---
kernel/rcu/tasks.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index 76f952196a29..f763f60d5e50 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -292,7 +292,7 @@ static void cblist_init_generic(struct rcu_tasks *rtp)
shift++;
WRITE_ONCE(rtp->percpu_enqueue_shift, shift);
WRITE_ONCE(rtp->percpu_dequeue_lim, lim);
- smp_store_release(&rtp->percpu_enqueue_lim, lim);
+ WRITE_ONCE(rtp->percpu_enqueue_lim, lim);
pr_info("%s: Setting shift to %d and lim to %d rcu_task_cb_adjust=%d rcu_task_cpu_ids=%d.\n",
rtp->name, data_race(rtp->percpu_enqueue_shift), data_race(rtp->percpu_enqueue_lim),
--
2.48.1
next reply other threads:[~2025-12-14 2:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-14 2:49 Zqiang [this message]
2025-12-25 18:57 ` [PATCH] rcu-tasks: Remove unnecessary smp_store operations in the cblist_init_generic() Paul E. McKenney
2025-12-31 7:55 ` Zqiang
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=20251214024904.121128-1-qiang.zhang@linux.dev \
--to=qiang.zhang@linux.dev \
--cc=frederic@kernel.org \
--cc=joelagnelf@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=rcu@vger.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.