lkml.org 
[lkml]   [2021]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 31/38] rcu: Replace deprecated CPU-hotplug functions.
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@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>
> Cc: rcu@vger.kernel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

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@kernel.org>

> ---
> 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
>

\
 
 \ /
  Last update: 2021-08-03 18:00    [W:0.453 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site