Skip to content

Commit 64ec8b6

Browse files
paulmckrcuurezki
authored andcommitted
ftrace: Choose RCU Tasks based on TASKS_RCU rather than PREEMPTION
The advent of CONFIG_PREEMPT_AUTO, AKA lazy preemption, will mean that even kernels built with CONFIG_PREEMPT_NONE or CONFIG_PREEMPT_VOLUNTARY might see the occasional preemption, and that this preemption just might happen within a trampoline. Therefore, update ftrace_shutdown() to invoke synchronize_rcu_tasks() based on CONFIG_TASKS_RCU instead of CONFIG_PREEMPTION. [ paulmck: Apply Steven Rostedt feedback. ] Signed-off-by: Paul E. McKenney <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Ankur Arora <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: <[email protected]> Signed-off-by: Uladzislau Rezki (Sony) <[email protected]>
1 parent 1e52af7 commit 64ec8b6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/trace/ftrace.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3157,8 +3157,7 @@ int ftrace_shutdown(struct ftrace_ops *ops, int command)
31573157
* synchronize_rcu_tasks() will wait for those tasks to
31583158
* execute and either schedule voluntarily or enter user space.
31593159
*/
3160-
if (IS_ENABLED(CONFIG_PREEMPTION))
3161-
synchronize_rcu_tasks();
3160+
synchronize_rcu_tasks();
31623161

31633162
ftrace_trampoline_free(ops);
31643163
}

0 commit comments

Comments
 (0)