All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Riabchun <ferr.lambarginio@gmail.com>
To: rostedt@goodmis.org
Cc: mhiramat@kernel.org, mark.rutland@arm.com,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: [PATCH] ftrace: Fix softlockup in ftrace_module_enable
Date: Thu, 11 Sep 2025 15:33:15 +0200	[thread overview]
Message-ID: <aMLPm__QGrQCwz1t@vova-pc> (raw)

A soft lockup was observed when loading amdgpu module,
this is the same issue that was fixed in
commit d0b24b4e91fc ("ftrace: Prevent RCU stall on PREEMPT_VOLUNTARY
kernels") and commit 42ea22e754ba ("ftrace: Add cond_resched() to
ftrace_graph_set_hash()").

Fix it the same way by adding cond_resched() in ftrace_module_enable.

Signed-off-by: Vladimir Riabchun <ferr.lambarginio@gmail.com>
---
 kernel/trace/ftrace.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index a69067367c29..23c4d37c7bcd 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -7526,6 +7526,9 @@ void ftrace_module_enable(struct module *mod)
 
 	do_for_each_ftrace_rec(pg, rec) {
 		int cnt;
+
+		cond_resched();
+
 		/*
 		 * do_for_each_ftrace_rec() is a double loop.
 		 * module text shares the pg. If a record is
-- 
2.43.0


             reply	other threads:[~2025-09-11 13:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-11 13:33 Vladimir Riabchun [this message]
2025-09-11 13:38 ` [PATCH] ftrace: Fix softlockup in ftrace_module_enable Masami Hiramatsu
2025-09-11 14:41 ` Steven Rostedt
2025-09-11 18:16   ` Vladimir Riabchun
2025-09-11 18:37     ` Steven Rostedt
2025-09-11 18:42       ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aMLPm__QGrQCwz1t@vova-pc \
    --to=ferr.lambarginio@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.