mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rcu: Force quiescent states only for ongoing grace period
@ 2023-11-01  3:35 Zqiang
  2023-11-03  2:54 ` Paul E. McKenney
  0 siblings, 1 reply; 6+ messages in thread
From: Zqiang @ 2023-11-01  3:35 UTC (permalink / raw)
  To: paulmck, frederic, joel, boqun.feng; +Cc: qiang.zhang1211, rcu, linux-kernel

Currently, when running the rcutorture testing, if the fqs_task
kthread was created, the periodic fqs operations will be performed,
regardless of whether the grace-period is ongoing. however, if there
is no ongoing grace-period, invoke the rcu_force_quiescent_state() has
no effect, because when the new grace-period starting, will clear all
flags int rcu_state.gp_flags in rcu_gp_init(). this commit therefore add
rcu_gp_in_progress() check in rcu_force_quiescent_state(), if there is
no ongoing grace-period, return directly.

Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
---
 kernel/rcu/tree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index aa4c808978b8..5b4279ef66da 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2338,6 +2338,8 @@ void rcu_force_quiescent_state(void)
 	struct rcu_node *rnp;
 	struct rcu_node *rnp_old = NULL;
 
+	if (!rcu_gp_in_progress())
+		return;
 	/* Funnel through hierarchy to reduce memory contention. */
 	rnp = raw_cpu_read(rcu_data.mynode);
 	for (; rnp != NULL; rnp = rnp->parent) {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-07 16:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-01  3:35 [PATCH] rcu: Force quiescent states only for ongoing grace period Zqiang
2023-11-03  2:54 ` Paul E. McKenney
2023-11-03  7:14   ` Z qiang
2023-11-03 18:06     ` Paul E. McKenney
2023-11-07  6:30       ` Z qiang
2023-11-07 16:53         ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®