Skip to content

Commit d0b24b4

Browse files
guilhermepiccolirostedt
authored andcommitted
ftrace: Prevent RCU stall on PREEMPT_VOLUNTARY kernels
The function match_records() may take a while due to a large number of string comparisons, so when in PREEMPT_VOLUNTARY kernels we could face RCU stalls due to that. Add a cond_resched() to prevent that. Link: https://lkml.kernel.org/r/20221115204847.593616-1-gpiccoli@igalia.com Cc: Mark Rutland <mark.rutland@arm.com> Suggested-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Paul E. McKenney <paulmck@kernel.org> # from RCU CPU stall warning perspective Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent fb9f5ee commit d0b24b4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

kernel/trace/ftrace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4204,6 +4204,7 @@ match_records(struct ftrace_hash *hash, char *func, int len, char *mod)
42044204
}
42054205
found = 1;
42064206
}
4207+
cond_resched();
42074208
} while_for_each_ftrace_rec();
42084209
out_unlock:
42094210
mutex_unlock(&ftrace_lock);

0 commit comments

Comments
 (0)