Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a738eec6 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcu: Correctly initialize ->rcu_qs_ctr_snap at online time



The rcu_data structure's ->rcu_qs_ctr_snap field is initialized at
CPU-online time from the current CPU's element of the per-CPU rcu_qs_ctr
variable.  Unfortunately, this is at CPU_UP_PREPARE time, so has nothing
to do with the CPU being onlined.  This commit therefore initializes
this variable from the incoming CPU's element of rcu_qs_ctr.

Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent cce7f1fc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3763,7 +3763,7 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp)
	rdp->gpnum = rnp->completed; /* Make CPU later note any new GP. */
	rdp->completed = rnp->completed;
	rdp->passed_quiesce = false;
	rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_qs_ctr);
	rdp->rcu_qs_ctr_snap = per_cpu(rcu_qs_ctr, cpu);
	rdp->qs_pending = false;
	trace_rcu_grace_period(rsp->name, rdp->gpnum, TPS("cpuonl"));
	raw_spin_unlock_irqrestore(&rnp->lock, flags);