diff options
author | Guilherme G. Piccoli <gpiccoli@igalia.com> | 2022-11-15 17:48:47 -0300 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-12-14 11:16:35 -0500 |
commit | d0b24b4e91fcb8408c4979888547f86be514e337 (patch) | |
tree | 94fde9dab3e89b07ae4a9271f2ef74d59a7f7039 /kernel | |
parent | fb9f5ee9bf5cf7ebc8731a7033e57d98832dc650 (diff) | |
download | lwn-d0b24b4e91fcb8408c4979888547f86be514e337.tar.gz lwn-d0b24b4e91fcb8408c4979888547f86be514e337.zip |
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/ftrace.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index d04552c0c275..b8e374a372e5 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -4204,6 +4204,7 @@ match_records(struct ftrace_hash *hash, char *func, int len, char *mod) } found = 1; } + cond_resched(); } while_for_each_ftrace_rec(); out_unlock: mutex_unlock(&ftrace_lock); |