[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240228152236.7a4c9eec@gandalf.local.home>
Date: Wed, 28 Feb 2024 15:22:36 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: linux-trace-kernel@...r.kernel.org, linux-kernel@...r.kernel.org, Masami
Hiramatsu <mhiramat@...nel.org>, Mark Rutland <mark.rutland@....com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Ankur Arora
<ankur.a.arora@...cle.com>, Thomas Gleixner <tglx@...utronix.de>,
kernel-team@...a.com
Subject: Re: [PATCH RFC ftrace] Chose RCU Tasks based on TASKS_RCU rather
than PREEMPTION
On Wed, 28 Feb 2024 11:38:29 -0800
"Paul E. McKenney" <paulmck@...nel.org> wrote:
> 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.
>
> Only build tested.
>
> Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Cc: Masami Hiramatsu <mhiramat@...nel.org>
> Cc: Mark Rutland <mark.rutland@....com>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
> Cc: Ankur Arora <ankur.a.arora@...cle.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: <linux-trace-kernel@...r.kernel.org>
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 2da4eaa2777d6..c9e6c69cf3446 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -3156,7 +3156,7 @@ int ftrace_shutdown(struct ftrace_ops *ops, int command)
> * synchronize_rcu_tasks() will wait for those tasks to
> * execute and either schedule voluntarily or enter user space.
> */
> - if (IS_ENABLED(CONFIG_PREEMPTION))
> + if (IS_ENABLED(CONFIG_TASKS_RCU))
> synchronize_rcu_tasks();
What happens if CONFIG_TASKS_RCU is not enabled? Does
synchronize_rcu_tasks() do anything? Or is it just a synchronize_rcu()?
If that's the case, perhaps just remove the if statement and make it:
synchronize_rcu_tasks();
Not sure an extra synchronize_rcu() will hurt (especially after doing a
synchronize_rcu_tasks_rude() just before hand!
-- Steve
Powered by blists - more mailing lists