From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Vladimir Riabchun <ferr.lambarginio@gmail.com>
Cc: rostedt@goodmis.org, mhiramat@kernel.org, mark.rutland@arm.com,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] ftrace: Fix softlockup in ftrace_module_enable
Date: Thu, 11 Sep 2025 22:38:13 +0900 [thread overview]
Message-ID: <20250911223813.58c894b4c8ce8e3eba298c71@kernel.org> (raw)
In-Reply-To: <aMLPm__QGrQCwz1t@vova-pc>
On Thu, 11 Sep 2025 15:33:15 +0200
Vladimir Riabchun <ferr.lambarginio@gmail.com> wrote:
> 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.
>
Looks good to me.
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Thanks,
> 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
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2025-09-11 13:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 13:33 [PATCH] ftrace: Fix softlockup in ftrace_module_enable Vladimir Riabchun
2025-09-11 13:38 ` Masami Hiramatsu [this message]
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=20250911223813.58c894b4c8ce8e3eba298c71@kernel.org \
--to=mhiramat@kernel.org \
--cc=ferr.lambarginio@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox