From: Paul E. McKenney Date: Wed, 9 Oct 2024 18:00:41 +0000 (-0700) Subject: rcu: Allow short-circuiting of synchronize_rcu_tasks_rude() X-Git-Tag: v6.13-rc1~190^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=481aa5fca02a2ee85ca76571becca31f816c2420;p=thirdparty%2Fkernel%2Flinux.git rcu: Allow short-circuiting of synchronize_rcu_tasks_rude() There are now architectures for which all deep-idle and entry-exit functions are properly inlined or marked noinstr. Such architectures do not need synchronize_rcu_tasks_rude(), or will not once RCU Tasks has been modified to pay attention to idle tasks. This commit therefore allows a CONFIG_ARCH_HAS_NOINSTR_MARKINGS Kconfig option to turn synchronize_rcu_tasks_rude() into a no-op. To facilitate testing, kernels built by rcutorture scripting will enable RCU Tasks Trace even on systems that do not need it. [ paulmck: Apply Peter Zijlstra feedback. ] Signed-off-by: Paul E. McKenney Cc: Peter Zijlstra Signed-off-by: Neeraj Upadhyay Signed-off-by: Frederic Weisbecker --- diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 6333f4ccf024b..dd9730fd44fbe 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -1398,7 +1398,8 @@ static void call_rcu_tasks_rude(struct rcu_head *rhp, rcu_callback_t func) */ void synchronize_rcu_tasks_rude(void) { - synchronize_rcu_tasks_generic(&rcu_tasks_rude); + if (!IS_ENABLED(CONFIG_ARCH_WANTS_NO_INSTR) || IS_ENABLED(CONFIG_FORCE_TASKS_RUDE_RCU)) + synchronize_rcu_tasks_generic(&rcu_tasks_rude); } EXPORT_SYMBOL_GPL(synchronize_rcu_tasks_rude);