* [PATCH] rcu: simplify rcu_sr_normal_gp_init()
@ 2026-12-02 16:49 Bradley Morgan
0 siblings, 0 replies; only message in thread
From: Bradley Morgan @ 2026-12-02 16:49 UTC (permalink / raw)
To: Paul E . McKenney, Frederic Weisbecker, Neeraj Upadhyay,
Joel Fernandes
Cc: Josh Triplett, Boqun Feng, Uladzislau Rezki, Steven Rostedt,
Mathieu Desnoyers, Lai Jiangshan, Zqiang, rcu, linux-kernel,
Bradley Morgan
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-02 16:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 16:49 [PATCH] rcu: simplify rcu_sr_normal_gp_init() Bradley Morgan
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.