On Thu, 11 Sep 2025 15:33:15 +0200
Vladimir Riabchun <[email protected]> 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) <[email protected]>

Thanks,

> Signed-off-by: Vladimir Riabchun <[email protected]>
> ---
>  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) <[email protected]>

Reply via email to