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/[email protected] Cc: Mark Rutland <[email protected]> Suggested-by: Steven Rostedt <[email protected]> Acked-by: Paul E. McKenney <[email protected]> # from RCU CPU stall warning perspective Signed-off-by: Guilherme G. Piccoli <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent fb9f5ee commit d0b24b4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)