[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+JQ8GX82Gn+7ZWe@lothringen>
Date: Tue, 7 Feb 2023 14:24:00 +0100
From: Frederic Weisbecker <frederic@...nel.org>
To: "Joel Fernandes (Google)" <joel@...lfernandes.org>
Cc: linux-kernel@...r.kernel.org, Qiang Zhang <Qiang1.zhang@...el.com>,
Josh Triplett <josh@...htriplett.org>,
Lai Jiangshan <jiangshanlai@...il.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
"Paul E. McKenney" <paulmck@...nel.org>, rcu@...r.kernel.org,
Steven Rostedt <rostedt@...dmis.org>,
Boqun Feng <boqun.feng@...il.com>
Subject: Re: [PATCH] rcu/tree: Improve comments in rcu_report_qs_rdp()
On Sat, Feb 04, 2023 at 02:20:50AM +0000, Joel Fernandes (Google) wrote:
> Recent discussion triggered due to a patch linked below, from Qiang,
> shed light on the need to accelerate from QS reporting paths.
>
> Update the comments to capture this piece of knowledge.
>
> Link: https://lore.kernel.org/all/20230118073014.2020743-1-qiang1.zhang@intel.com/
> Cc: Qiang Zhang <Qiang1.zhang@...el.com>
> Cc: Frederic Weisbecker <frederic@...nel.org>
> Signed-off-by: Joel Fernandes (Google) <joel@...lfernandes.org>
>
> ---
> kernel/rcu/tree.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 93eb03f8ed99..713eb6ca6902 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1983,7 +1983,12 @@ rcu_report_qs_rdp(struct rcu_data *rdp)
> } else {
> /*
> * This GP can't end until cpu checks in, so all of our
> - * callbacks can be processed during the next GP.
> + * callbacks can be processed during the next GP. Do
> + * the acceleration from here otherwise there may be extra
> + * grace period delays, as any accelerations from rcu_core()
> + * or note_gp_changes() may happen only after the GP after the
> + * current one has already started. Further, rcu_core()
> + * only accelerates if RCU is idle (no GP in progress).
Actually note_gp_changes() should take care of that. My gut feeling is that the
acceleration in rcu_report_qs_rdp() only stands for:
* callbacks that may be enqueued from an IRQ firing during the small window
between the RNP unlock in note_gp_changes() and the RNP lock in
rcu_report_qs_rdp()
* __note_gp_changes() got called even before from the GP kthread, and callbacks
got enqueued between that and rcu_core().
Thanks.
Powered by blists - more mailing lists