[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201007231346.GA58749@lothringen>
Date: Thu, 8 Oct 2020 01:13:46 +0200
From: Frederic Weisbecker <frederic@...nel.org>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: "Joel Fernandes (Google)" <joel@...lfernandes.org>,
linux-kernel@...r.kernel.org, neeraju@...eaurora.org,
Josh Triplett <josh@...htriplett.org>,
Lai Jiangshan <jiangshanlai@...il.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
rcu@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH v2] rcu/tree: nocb: Avoid raising softirq when there are
ready to execute CBs
On Wed, Oct 07, 2020 at 03:34:38PM -0700, Paul E. McKenney wrote:
> On Sun, Oct 04, 2020 at 10:11:32PM -0400, Joel Fernandes (Google) wrote:
> > During testing, I see it is possible that rcu_pending() returns 1 when
> > offloaded callbacks are ready to execute thus raising the RCU softirq.
> >
> > However, softirq does not execute offloaded callbacks. They are executed in a
> > kthread which is awakened independent of the softirq.
> >
> > This commit therefore avoids raising the softirq in the first place. That's
> > probably a good thing considering that the purpose of callback offloading is to
> > reduce softirq activity.
> >
> > Passed 30 minute tests of TREE01 through TREE09 each.
> >
> > On TREE08, I notice that there is atmost 150us from when the softirq was
> > NOT raised when ready cbs were present, to when the ready callbacks were
> > invoked by the rcuop thread. This also further confirms that there is no
> > need to raise the softirq for ready cbs in the first place.
> >
> > Cc: neeraju@...eaurora.org
> > Signed-off-by: Joel Fernandes (Google) <joel@...lfernandes.org>
>
> Looks good, applied, thank you! I reworked things a bit based on
> previous patches and to more precisely capture why this patch does
> not cause additional problems. Please let me know if I messed
> anything up.
>
> Thanx, Paul
>
> ------------------------------------------------------------------------
>
> commit 33847a34a2d261354a79b4a24d9d37222e8ec888
> Author: Joel Fernandes (Google) <joel@...lfernandes.org>
> Date: Wed Oct 7 13:50:36 2020 -0700
>
> rcu/tree: nocb: Avoid raising softirq for offloaded ready-to-execute CBs
>
> Testing showed that rcu_pending() can return 1 when offloaded callbacks
> are ready to execute. This invokes RCU core processing, for example,
> by raising RCU_SOFTIRQ, eventually resulting in a call to rcu_core().
> However, rcu_core() explicitly avoids in any way manipulating offloaded
> callbacks, which are instead handled by the rcuog and rcuoc kthreads,
> which work independently of rcu_core().
>
> One exception to this independence is that rcu_core() invokes
> do_nocb_deferred_wakeup(), however, rcu_pending() also checks
> rcu_nocb_need_deferred_wakeup() in order to correctly handle this case,
> invoking rcu_core() when needed.
>
> This commit therefore avoids needlessly invoking RCU core processing
> by checking rcu_segcblist_ready_cbs() only on non-offloaded CPUs.
> This reduces overhead, for example, by reducing softirq activity.
>
> This change passed 30 minute tests of TREE01 through TREE09 each.
>
> On TREE08, there is at most 150us from the time that rcu_pending() chose
> not to invoke RCU core processing to the time when the ready callbacks
> were invoked by the rcuoc kthread. This provides further evidence that
> there is no need to invoke rcu_core() for offloaded callbacks that are
> ready to invoke.
>
> Cc: Neeraj Upadhyay <neeraju@...eaurora.org>
> Signed-off-by: Joel Fernandes (Google) <joel@...lfernandes.org>
> Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
Reviewed-by: Frederic Weisbecker <frederic@...nel.org>
Thanks!
Powered by blists - more mailing lists