linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] kernel/trace: fix watchdog soft lockup
@ 2018-11-28  8:13 Anders Roxell
  2018-11-28 14:09 ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Anders Roxell @ 2018-11-28  8:13 UTC (permalink / raw)
  To: rostedt, mingo; +Cc: akpm, dvyukov, linux-kernel, Anders Roxell, Arnd Bergmann

When building a allmodconfig kernel for arm64 and boot that in qemu,
CONFIG_FTRACE_STARTUP_TEST gets enabled and that takes time so the
watchdog expires and prints out a message like this:
'watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1]'
Each time the function ftrace_replace_code gets called it stays in that
functions loop for 41424 times.
Rework so that function cond_resched() gets called in the
ftrace_replace_code loop.

Co-developed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 kernel/trace/ftrace.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 5b4f73e4fd56..3f456921dedf 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2426,6 +2426,10 @@ void __weak ftrace_replace_code(int enable)
 
 	do_for_each_ftrace_rec(pg, rec) {
 
+		/* This loop can take minutes when sanitizers are enabled, so
+		 * lets make sure we allow RCU processing.
+		 */
+		cond_resched();
 		if (rec->flags & FTRACE_FL_DISABLED)
 			continue;
 
-- 
2.19.2


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

end of thread, other threads:[~2018-11-29  3:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-28  8:13 [PATCH 2/2] kernel/trace: fix watchdog soft lockup Anders Roxell
2018-11-28 14:09 ` Steven Rostedt
2018-11-28 22:24   ` Arnd Bergmann
2018-11-29  3:24     ` Steven Rostedt

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).