[PATCH 1/4] rcu: Remove needless polling work requeue for further waiter

From: Frederic Weisbecker
Date: Wed Mar 16 2022 - 10:43:11 EST


If another expedited polling site is waiting for the next grace period,
there is no need to requeue the work because it is guaranteed to be
either already queued or executing the actual polling upon completion.

Signed-off-by: Frederic Weisbecker <frederic@xxxxxxxxxx>
Cc: Neeraj Upadhyay <quic_neeraju@xxxxxxxxxxx>
Cc: Boqun Feng <boqun.feng@xxxxxxxxx>
Cc: Uladzislau Rezki <uladzislau.rezki@xxxxxxxx>
Cc: Joel Fernandes <joel@xxxxxxxxxxxxxxxxx>
---
kernel/rcu/tree_exp.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
index a6cb02a4d27c..b6fd857f34ba 100644
--- a/kernel/rcu/tree_exp.h
+++ b/kernel/rcu/tree_exp.h
@@ -919,9 +919,7 @@ static void sync_rcu_do_polled_gp(struct work_struct *wp)
__synchronize_rcu_expedited(true);
raw_spin_lock_irqsave(&rnp->exp_poll_lock, flags);
s = rnp->exp_seq_poll_rq;
- if (!(s & 0x1) && !sync_exp_work_done(s))
- queue_work(rcu_gp_wq, &rnp->exp_poll_wq);
- else
+ if (!(s & 0x1) && sync_exp_work_done(s))
rnp->exp_seq_poll_rq |= 0x1;
raw_spin_unlock_irqrestore(&rnp->exp_poll_lock, flags);
}
--
2.25.1