Re: RCU stall on 6.1-rc4 (and some previous releases) related to ftrace

From: Steven Rostedt
Date: Thu Nov 10 2022 - 19:17:01 EST


On Thu, 10 Nov 2022 18:25:41 -0300
"Guilherme G. Piccoli" <gpiccoli@xxxxxxxxxx> wrote:

> @@ -4184,6 +4184,7 @@ match_records(struct ftrace_hash *hash, char *func, int len, char *mod)
> if (rec->flags & FTRACE_FL_DISABLED)
> continue;
>
> + cond_resched();
> if (ftrace_match_record(rec, &func_g, mod_match, exclude_mod)) {
> ret = enter_record(hash, rec, clear_filter);
> if (ret < 0) {

This isn't where I would put it. I would add it after the if statement.
That is, at the end of the loop.

-- Steve