From: Paul E. McKenney Date: Wed, 28 Feb 2024 19:30:43 +0000 (-0800) Subject: ftrace: Choose RCU Tasks based on TASKS_RCU rather than PREEMPTION X-Git-Tag: v6.10-rc1~234^2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=64ec8b6ad61997262fb3373970377f5fb709454b;p=thirdparty%2Fkernel%2Flinux.git 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 Cc: Steven Rostedt Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Ankur Arora Cc: Thomas Gleixner Cc: Signed-off-by: Uladzislau Rezki (Sony) --- diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index da1710499698b..6c96b30f3d63b 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -3157,8 +3157,7 @@ out: * synchronize_rcu_tasks() will wait for those tasks to * execute and either schedule voluntarily or enter user space. */ - if (IS_ENABLED(CONFIG_PREEMPTION)) - synchronize_rcu_tasks(); + synchronize_rcu_tasks(); ftrace_trampoline_free(ops); }