diff options
author | Frederic Weisbecker <frederic@kernel.org> | 2023-09-08 22:35:59 +0200 |
---|---|---|
committer | Frederic Weisbecker <frederic@kernel.org> | 2023-10-04 17:35:56 +0200 |
commit | c964c1f5ee96e1460606d44f80a47bdacd8fe568 (patch) | |
tree | 6de35eee1d52751eec81405a8b62b5f886c39cda /kernel/rcu | |
parent | rcu: Assume IRQS disabled from rcu_report_dead() (diff) | |
download | linux-c964c1f5ee96e1460606d44f80a47bdacd8fe568.tar.xz linux-c964c1f5ee96e1460606d44f80a47bdacd8fe568.zip |
rcu: Assume rcu_report_dead() is always called locally
rcu_report_dead() has to be called locally by the CPU that is going to
exit the RCU state machine. Passing a cpu argument here is error-prone
and leaves the possibility for a racy remote call.
Use local access instead.
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Diffstat (limited to 'kernel/rcu')
-rw-r--r-- | kernel/rcu/tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 8c2954502e55..2e1e7eadf2cc 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4560,11 +4560,11 @@ void rcu_cpu_starting(unsigned int cpu) * from the outgoing CPU rather than from the cpuhp_step mechanism. * This is because this function must be invoked at a precise location. */ -void rcu_report_dead(unsigned int cpu) +void rcu_report_dead(void) { unsigned long flags; unsigned long mask; - struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu); + struct rcu_data *rdp = this_cpu_ptr(&rcu_data); struct rcu_node *rnp = rdp->mynode; /* Outgoing CPU's rdp & rnp. */ /* |