rcu: Make rcutree_dying_cpu() use its "cpu" parameter
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 30 Jul 2021 03:30:32 +0000 (20:30 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 13 Sep 2021 23:32:46 +0000 (16:32 -0700)
The CPU-hotplug functions take a "cpu" parameter, but rcutree_dying_cpu()
ignores it in favor of this_cpu_ptr().  This works at the moment, but
it would be better to be consistent.  This might also work better given
some possible future changes.  This commit therefore uses per_cpu_ptr()
to avoid ignoring the rcutree_dying_cpu() function's argument.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c

index dc29684..6a1e9d3 100644 (file)
@@ -2356,7 +2356,7 @@ rcu_check_quiescent_state(struct rcu_data *rdp)
 int rcutree_dying_cpu(unsigned int cpu)
 {
        bool blkd;
-       struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
+       struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu);
        struct rcu_node *rnp = rdp->mynode;
 
        if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))