Re: [PATCH 31/38] rcu: Replace deprecated CPU-hotplug functions.

From: Paul E. McKenney
Date: Tue Aug 03 2021 - 12:00:25 EST


On Tue, Aug 03, 2021 at 04:16:14PM +0200, Sebastian Andrzej Siewior wrote:
> The functions get_online_cpus() and put_online_cpus() have been
> deprecated during the CPU hotplug rework. They map directly to
> cpus_read_lock() and cpus_read_unlock().
>
> Replace deprecated CPU-hotplug functions with the official version.
> The behavior remains unchanged.
>
> Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxx>
> Cc: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> Cc: Lai Jiangshan <jiangshanlai@xxxxxxxxx>
> Cc: Joel Fernandes <joel@xxxxxxxxxxxxxxxxx>
> Cc: rcu@xxxxxxxxxxxxxxx
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>

I have queued this one and 35/38 (rcutorture) for v5.16. If you would
prefer to send them some other route, please let me know and:

Acked-by: Paul E. McKenney <paulmck@xxxxxxxxxx>

> ---
> kernel/rcu/tree.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 51f24ecd94b26..f116ce58f4e68 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -4050,7 +4050,7 @@ void rcu_barrier(void)
> */
> init_completion(&rcu_state.barrier_completion);
> atomic_set(&rcu_state.barrier_cpu_count, 2);
> - get_online_cpus();
> + cpus_read_lock();
>
> /*
> * Force each CPU with callbacks to register a new callback.
> @@ -4081,7 +4081,7 @@ void rcu_barrier(void)
> rcu_state.barrier_sequence);
> }
> }
> - put_online_cpus();
> + cpus_read_unlock();
>
> /*
> * Now that we have an rcu_barrier_callback() callback on each
> --
> 2.32.0
>