Re: [PATCH v2] rcu: Allow to eliminate softirq processing from rcutree

From: Paul E. McKenney
Date: Wed Mar 20 2019 - 11:21:04 EST


On Wed, Mar 20, 2019 at 12:32:19PM +0100, Sebastian Andrzej Siewior wrote:
> On 2019-03-19 12:44:19 [+0100], To Paul E. McKenney wrote:
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index 0f31b79eb6761..0a719f726e149 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> â
> > +/*
> > + * Spawn per-CPU RCU core processing kthreads.
> > + */
> > +static int __init rcu_spawn_core_kthreads(void)
> > +{
> > + int cpu;
> > +
> > + for_each_possible_cpu(cpu)
> > + per_cpu(rcu_data.rcu_cpu_has_work, cpu) = 0;
> > + if (!IS_ENABLED(CONFIG_RCU_BOOST) && !rcu_softirq_enabled)
>
> and this needs to become
> - if (!IS_ENABLED(CONFIG_RCU_BOOST) && !rcu_softirq_enabled)
> + if (!IS_ENABLED(CONFIG_RCU_BOOST) && rcu_softirq_enabled)
>
> With this change and hunk that I just sent to Joel I get thee three RCU
> modes with and without BOOST booted.
>
> Unless there is something (and Paul agrees that the Joel hunk is
> correct) I would post a v3 with those changes included.

Well, I did get a bunch of grace-period hangs of various sorts when I
ran rcutorture like this:

tools/testing/selftests/rcutorture/bin/kvm.sh --memory 1G --bootargs rcunosoftirq

I also got a silent hard hang on TREE03. And an rcutorture forward-progress
failure, which goes along with the grace-period hangs.

So something does need adjustment. I will try again with this change.

Thanx, Paul

> > + return 0;
> > + WARN_ONCE(smpboot_register_percpu_thread(&rcu_cpu_thread_spec), "%s: Could not start rcub kthread, OOM is now expected behavior\n", __func__);
> > + return 0;
> > +}
> > +early_initcall(rcu_spawn_core_kthreads);
>
> Sebastian
>