Re: [PATCH] rcu: Make rcu_state.n_online_cpus updates atomic

From: Woodhouse, David
Date: Mon Dec 13 2021 - 03:09:38 EST


On Mon, 2021-12-13 at 12:30 +0530, Neeraj Upadhyay wrote:
> To support onlining multiple CPUs concurrently,
> change rcu_state.n_online_cpus updates to be atomic.
> Note, it's ok for rcu_blocking_is_gp() to do a
> atomic_read(&rcu_state.n_online_cpus), as the
> value of .n_online_cpus switches from 1->2, in
> rcutree_prepare_cpu(), which runs before the new
> CPU comes online. Similarly 2->1 transition happens
> from rcutree_dead_cpu(), which executes after the
> CPU is offlined, and runs on the last online CPU.
>
> Signed-off-by: Neeraj Upadhyay <quic_neeraju@xxxxxxxxxxx>

In my parallel-bringup series, the prepare stages are still being
executed in series on the BSP, so I don't think this patch is needed
yet. I'm not sure we'd ever end up with the prepare stages being done
in parallel — the most I see us doing is onlining a single *batch* of
CPUs at a time, much like bringup_nonboot_cpus() does.

But this patch certainly doesn't *hurt*.

Acked-by: David Woodhouse <dwmw@xxxxxxxxxxxx>





Amazon Development Centre (London) Ltd. Registered in England and Wales with registration number 04543232 with its registered office at 1 Principal Place, Worship Street, London EC2A 2FA, United Kingdom.