lkml.org 
[lkml]   [2020]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 11/12] rcu: Locally accelerate callbacks as long as offloading isn't complete
On Mon, Sep 21, 2020 at 02:43:50PM +0200, Frederic Weisbecker wrote:
> I have no idea what I'm doing but doing that looks necessary to me.

Now -there- is a commit log that inspires confidence!!! ;-)

> Inspired-by: Paul E. McKenney <paulmck@kernel.org>
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> Cc: Paul E. McKenney <paulmck@kernel.org>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: Lai Jiangshan <jiangshanlai@gmail.com>
> Cc: Joel Fernandes <joel@joelfernandes.org>
> ---
> kernel/rcu/tree.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 928907e9ba94..8cef5ea8d1f0 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2619,7 +2619,6 @@ static __latent_entropy void rcu_core(void)
> unsigned long flags;
> struct rcu_data *rdp = raw_cpu_ptr(&rcu_data);
> struct rcu_node *rnp = rdp->mynode;
> - const bool offloaded = rcu_segcblist_is_offloaded(&rdp->cblist);
> const bool do_batch = !rcu_segcblist_completely_offloaded(&rdp->cblist);
>
> if (cpu_is_offline(smp_processor_id()))
> @@ -2640,11 +2639,11 @@ static __latent_entropy void rcu_core(void)
>
> /* No grace period and unregistered callbacks? */
> if (!rcu_gp_in_progress() &&
> - rcu_segcblist_is_enabled(&rdp->cblist) && !offloaded) {
> - local_irq_save(flags);
> + rcu_segcblist_is_enabled(&rdp->cblist) && do_batch) {
> + rcu_nocb_lock_irqsave(rdp, flags);
> if (!rcu_segcblist_restempty(&rdp->cblist, RCU_NEXT_READY_TAIL))
> rcu_accelerate_cbs_unlocked(rnp, rdp);

It might also be that rcu_advance_cbs() is needed somewhere. I will
need to look carefully to work out whether either of them need to be
invoked at this particular point in the code.

Thanx, Paul

> - local_irq_restore(flags);
> + rcu_nocb_unlock_irqrestore(rdp, flags);
> }
>
> rcu_check_gp_start_stall(rnp, rdp, rcu_jiffies_till_stall_check());
> --
> 2.28.0
>

\
 
 \ /
  Last update: 2020-09-22 02:25    [W:0.219 / U:6.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site