[PATCH] rcu: simplify rcu_sr_normal_gp_init()

From: Bradley Morgan

Date: Wed Dec 02 2026 - 11:49:44 EST


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@xxxxxxxxx>
---
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