rcu: Move rcu_data.cpu_no_qs.b.exp reset to rcu_export_exp_rdp()
authorFrederic Weisbecker <frederic@kernel.org>
Thu, 16 Sep 2021 12:10:47 +0000 (14:10 +0200)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 8 Dec 2021 00:22:21 +0000 (16:22 -0800)
On non-preemptible RCU, move clearing of the rcu_data structure's
->cpu_no_qs.b.exp filed to the actual expedited quiescent state report
function, matching hw preemptible RCU handles the ->exp_deferred_qs field.

This prepares for removing ->exp_deferred_qs in favor of ->cpu_no_qs.b.exp
for both preemptible and non-preemptible RCU.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree_exp.h
kernel/rcu/tree_plugin.h

index f3947c49eee7161c45b4a16547e00dc0478a567d..6c6eb32203852e9b6deb3a5568efed9d468168f3 100644 (file)
@@ -256,6 +256,7 @@ static void rcu_report_exp_cpu_mult(struct rcu_node *rnp,
 static void rcu_report_exp_rdp(struct rcu_data *rdp)
 {
        WRITE_ONCE(rdp->exp_deferred_qs, false);
+       WRITE_ONCE(rdp->cpu_no_qs.b.exp, false);
        rcu_report_exp_cpu_mult(rdp->mynode, rdp->grpmask, true);
 }
 
index 113c19b086ace180d2cc4aa43cd02206a89a04fb..6d58b75d2782e84f774e3174e44d0fc548803455 100644 (file)
@@ -849,10 +849,8 @@ static void rcu_qs(void)
        trace_rcu_grace_period(TPS("rcu_sched"),
                               __this_cpu_read(rcu_data.gp_seq), TPS("cpuqs"));
        __this_cpu_write(rcu_data.cpu_no_qs.b.norm, false);
-       if (!__this_cpu_read(rcu_data.cpu_no_qs.b.exp))
-               return;
-       __this_cpu_write(rcu_data.cpu_no_qs.b.exp, false);
-       rcu_report_exp_rdp(this_cpu_ptr(&rcu_data));
+       if (__this_cpu_read(rcu_data.cpu_no_qs.b.exp))
+               rcu_report_exp_rdp(this_cpu_ptr(&rcu_data));
 }
 
 /*