linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/debug: avoid executing show_state and causing rcu stall warning
@ 2022-08-03  1:18 Liu Song
  2022-08-03  8:39 ` Ingo Molnar
  2022-08-03 12:42 ` Steven Rostedt
  0 siblings, 2 replies; 10+ messages in thread
From: Liu Song @ 2022-08-03  1:18 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid
  Cc: linux-kernel

From: Liu Song <liusong@linux.alibaba.com>

If the number of CPUs is large, "sysrq_sched_debug_show" will execute for
a long time. Every time I execute "echo t > /proc/sysrq-trigger" on my
128-core machine, the rcu stall warning will be triggered. Moreover,
sysrq_sched_debug_show does not need to be protected by rcu_read_lock,
and no rcu stall warning will appear after adjustment.

Signed-off-by: Liu Song <liusong@linux.alibaba.com>
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 5555e49..82c117e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8879,11 +8879,11 @@ void show_state_filter(unsigned int state_filter)
 			sched_show_task(p);
 	}
 
+	rcu_read_unlock();
 #ifdef CONFIG_SCHED_DEBUG
 	if (!state_filter)
 		sysrq_sched_debug_show();
 #endif
-	rcu_read_unlock();
 	/*
 	 * Only show locks if all tasks are dumped:
 	 */
-- 
1.8.3.1


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

end of thread, other threads:[~2022-08-03 17:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03  1:18 [PATCH] sched/debug: avoid executing show_state and causing rcu stall warning Liu Song
2022-08-03  8:39 ` Ingo Molnar
2022-08-03  8:58   ` Liu Song
2022-08-03  9:10     ` Ingo Molnar
2022-08-03  9:25       ` Liu Song
2022-08-03 12:42 ` Steven Rostedt
2022-08-03 14:06   ` Paul E. McKenney
2022-08-03 17:14     ` Ingo Molnar
2022-08-03 17:42       ` Paul E. McKenney
2022-08-03 17:13   ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).