mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rcu-tasks: Check the atomic variable trc_n_readers_need_end again when wait timeout
@ 2022-03-30 11:20 Zqiang
  2022-03-30 19:05 ` Paul E. McKenney
  0 siblings, 1 reply; 6+ messages in thread
From: Zqiang @ 2022-03-30 11:20 UTC (permalink / raw)
  To: paulmck, frederic; +Cc: rcu, linux-kernel

When the trc_wait waitqueue timeout, the atomic variable
trc_n_readers_need_end need to be checked again, perhaps the
conditions have been established at this time, avoid invalid
stall information output.

Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
 kernel/rcu/tasks.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index 65d6e21a607a..b73a2b362d6b 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -1544,7 +1544,7 @@ static void rcu_tasks_trace_postgp(struct rcu_tasks *rtp)
 				trc_wait,
 				atomic_read(&trc_n_readers_need_end) == 0,
 				READ_ONCE(rcu_task_stall_timeout));
-		if (ret)
+		if (ret || !atomic_read(&trc_n_readers_need_end))
 			break;  // Count reached zero.
 		// Stall warning time, so make a list of the offenders.
 		rcu_read_lock();
-- 
2.25.1


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

end of thread, other threads:[~2022-04-01  0:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 11:20 [PATCH] rcu-tasks: Check the atomic variable trc_n_readers_need_end again when wait timeout Zqiang
2022-03-30 19:05 ` Paul E. McKenney
2022-03-30 22:30   ` Zhang, Qiang1
2022-03-31  2:03     ` Zhang, Qiang1
2022-03-31 19:24       ` Paul E. McKenney
2022-04-01  0:23         ` Zhang, Qiang1

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®