From: Bradley Morgan <bradley.morgan@linux.dev>
To: "Paul E . McKenney" <paulmck@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
Joel Fernandes <joelagnelf@nvidia.com>
Cc: Josh Triplett <josh@joshtriplett.org>,
Boqun Feng <boqun@kernel.org>,
Uladzislau Rezki <urezki@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Zqiang <qiang.zhang@linux.dev>,
rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
Bradley Morgan <bradley.morgan@linux.dev>
Subject: [PATCH] rcu: simplify rcu_sr_normal_gp_init()
Date: Wed, 2 Dec 2026 16:49:28 +0000 [thread overview]
Message-ID: <20261202164928.327410-1-bradley.morgan@linux.dev> (raw)
rcu_sr_normal_gp_init() has a start_new_poll variable that is always
false on the first return, is set to true only when
rcu_sr_get_wait_head() fails, and is false again at the end. The
variable buys nothing, so return the constants directly.
Signed-off-by: Bradley Morgan <bradley.morgan@linux.dev>
---
kernel/rcu/tree.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index aea3aef7397ec..729fc93e58627 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1774,17 +1774,15 @@ static bool rcu_sr_normal_gp_init(void)
{
struct llist_node *first;
struct llist_node *wait_head;
- bool start_new_poll = false;
first = READ_ONCE(rcu_state.srs_next.first);
if (!first || rcu_sr_is_wait_head(first))
- return start_new_poll;
+ return false;
wait_head = rcu_sr_get_wait_head();
if (!wait_head) {
// Kick another GP to retry.
- start_new_poll = true;
- return start_new_poll;
+ return true;
}
/* Inject a wait-dummy-node. */
@@ -1799,7 +1797,7 @@ static bool rcu_sr_normal_gp_init(void)
rcu_state.srs_wait_tail = wait_head;
ASSERT_EXCLUSIVE_WRITER(rcu_state.srs_wait_tail);
- return start_new_poll;
+ return false;
}
static void rcu_sr_normal_add_req(struct rcu_synchronize *rs)
--
2.53.0
reply other threads:[~2026-12-02 16:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261202164928.327410-1-bradley.morgan@linux.dev \
--to=bradley.morgan@linux.dev \
--cc=boqun@kernel.org \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=joelagnelf@nvidia.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=qiang.zhang@linux.dev \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=urezki@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox