diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-08-06 17:17:29 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-09-21 00:16:21 -0400 |
commit | 0d43eb34f9aabcddf41c99b7af2d0ced33e9a3cc (patch) | |
tree | ae248d15b7c20f943f0604654980265e7c74bc02 /kernel/rcu/tree.c | |
parent | 97c668b8e983b722e2ed765b98b05f644aff1b13 (diff) |
rcu: Invert passed_quiesce and rename to cpu_no_qs
This commit inverts the sense of the rcu_data structure's ->passed_quiesce
field and renames it to ->cpu_no_qs. This will allow a later commit to
use an "aggregate OR" operation to test expedited as well as normal grace
periods without added overhead.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r-- | kernel/rcu/tree.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 7c158ffc7769..31e7021ced4d 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -245,21 +245,21 @@ static int rcu_gp_in_progress(struct rcu_state *rsp) | |||
245 | */ | 245 | */ |
246 | void rcu_sched_qs(void) | 246 | void rcu_sched_qs(void) |
247 | { | 247 | { |
248 | if (!__this_cpu_read(rcu_sched_data.passed_quiesce)) { | 248 | if (__this_cpu_read(rcu_sched_data.cpu_no_qs)) { |
249 | trace_rcu_grace_period(TPS("rcu_sched"), | 249 | trace_rcu_grace_period(TPS("rcu_sched"), |
250 | __this_cpu_read(rcu_sched_data.gpnum), | 250 | __this_cpu_read(rcu_sched_data.gpnum), |
251 | TPS("cpuqs")); | 251 | TPS("cpuqs")); |
252 | __this_cpu_write(rcu_sched_data.passed_quiesce, 1); | 252 | __this_cpu_write(rcu_sched_data.cpu_no_qs, false); |
253 | } | 253 | } |
254 | } | 254 | } |
255 | 255 | ||
256 | void rcu_bh_qs(void) | 256 | void rcu_bh_qs(void) |
257 | { | 257 | { |
258 | if (!__this_cpu_read(rcu_bh_data.passed_quiesce)) { | 258 | if (__this_cpu_read(rcu_bh_data.cpu_no_qs)) { |
259 | trace_rcu_grace_period(TPS("rcu_bh"), | 259 | trace_rcu_grace_period(TPS("rcu_bh"), |
260 | __this_cpu_read(rcu_bh_data.gpnum), | 260 | __this_cpu_read(rcu_bh_data.gpnum), |
261 | TPS("cpuqs")); | 261 | TPS("cpuqs")); |
262 | __this_cpu_write(rcu_bh_data.passed_quiesce, 1); | 262 | __this_cpu_write(rcu_bh_data.cpu_no_qs, false); |
263 | } | 263 | } |
264 | } | 264 | } |
265 | 265 | ||
@@ -1744,7 +1744,7 @@ static bool __note_gp_changes(struct rcu_state *rsp, struct rcu_node *rnp, | |||
1744 | */ | 1744 | */ |
1745 | rdp->gpnum = rnp->gpnum; | 1745 | rdp->gpnum = rnp->gpnum; |
1746 | trace_rcu_grace_period(rsp->name, rdp->gpnum, TPS("cpustart")); | 1746 | trace_rcu_grace_period(rsp->name, rdp->gpnum, TPS("cpustart")); |
1747 | rdp->passed_quiesce = 0; | 1747 | rdp->cpu_no_qs = true; |
1748 | rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_qs_ctr); | 1748 | rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_qs_ctr); |
1749 | rdp->core_needs_qs = !!(rnp->qsmask & rdp->grpmask); | 1749 | rdp->core_needs_qs = !!(rnp->qsmask & rdp->grpmask); |
1750 | zero_cpu_stall_ticks(rdp); | 1750 | zero_cpu_stall_ticks(rdp); |
@@ -2337,7 +2337,7 @@ rcu_report_qs_rdp(int cpu, struct rcu_state *rsp, struct rcu_data *rdp) | |||
2337 | rnp = rdp->mynode; | 2337 | rnp = rdp->mynode; |
2338 | raw_spin_lock_irqsave(&rnp->lock, flags); | 2338 | raw_spin_lock_irqsave(&rnp->lock, flags); |
2339 | smp_mb__after_unlock_lock(); | 2339 | smp_mb__after_unlock_lock(); |
2340 | if ((rdp->passed_quiesce == 0 && | 2340 | if ((rdp->cpu_no_qs && |
2341 | rdp->rcu_qs_ctr_snap == __this_cpu_read(rcu_qs_ctr)) || | 2341 | rdp->rcu_qs_ctr_snap == __this_cpu_read(rcu_qs_ctr)) || |
2342 | rdp->gpnum != rnp->gpnum || rnp->completed == rnp->gpnum || | 2342 | rdp->gpnum != rnp->gpnum || rnp->completed == rnp->gpnum || |
2343 | rdp->gpwrap) { | 2343 | rdp->gpwrap) { |
@@ -2348,7 +2348,7 @@ rcu_report_qs_rdp(int cpu, struct rcu_state *rsp, struct rcu_data *rdp) | |||
2348 | * We will instead need a new quiescent state that lies | 2348 | * We will instead need a new quiescent state that lies |
2349 | * within the current grace period. | 2349 | * within the current grace period. |
2350 | */ | 2350 | */ |
2351 | rdp->passed_quiesce = 0; /* need qs for new gp. */ | 2351 | rdp->cpu_no_qs = true; /* need qs for new gp. */ |
2352 | rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_qs_ctr); | 2352 | rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_qs_ctr); |
2353 | raw_spin_unlock_irqrestore(&rnp->lock, flags); | 2353 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
2354 | return; | 2354 | return; |
@@ -2395,7 +2395,7 @@ rcu_check_quiescent_state(struct rcu_state *rsp, struct rcu_data *rdp) | |||
2395 | * Was there a quiescent state since the beginning of the grace | 2395 | * Was there a quiescent state since the beginning of the grace |
2396 | * period? If no, then exit and wait for the next call. | 2396 | * period? If no, then exit and wait for the next call. |
2397 | */ | 2397 | */ |
2398 | if (!rdp->passed_quiesce && | 2398 | if (rdp->cpu_no_qs && |
2399 | rdp->rcu_qs_ctr_snap == __this_cpu_read(rcu_qs_ctr)) | 2399 | rdp->rcu_qs_ctr_snap == __this_cpu_read(rcu_qs_ctr)) |
2400 | return; | 2400 | return; |
2401 | 2401 | ||
@@ -3828,11 +3828,11 @@ static int __rcu_pending(struct rcu_state *rsp, struct rcu_data *rdp) | |||
3828 | 3828 | ||
3829 | /* Is the RCU core waiting for a quiescent state from this CPU? */ | 3829 | /* Is the RCU core waiting for a quiescent state from this CPU? */ |
3830 | if (rcu_scheduler_fully_active && | 3830 | if (rcu_scheduler_fully_active && |
3831 | rdp->core_needs_qs && !rdp->passed_quiesce && | 3831 | rdp->core_needs_qs && rdp->cpu_no_qs && |
3832 | rdp->rcu_qs_ctr_snap == __this_cpu_read(rcu_qs_ctr)) { | 3832 | rdp->rcu_qs_ctr_snap == __this_cpu_read(rcu_qs_ctr)) { |
3833 | rdp->n_rp_core_needs_qs++; | 3833 | rdp->n_rp_core_needs_qs++; |
3834 | } else if (rdp->core_needs_qs && | 3834 | } else if (rdp->core_needs_qs && |
3835 | (rdp->passed_quiesce || | 3835 | (!rdp->cpu_no_qs || |
3836 | rdp->rcu_qs_ctr_snap != __this_cpu_read(rcu_qs_ctr))) { | 3836 | rdp->rcu_qs_ctr_snap != __this_cpu_read(rcu_qs_ctr))) { |
3837 | rdp->n_rp_report_qs++; | 3837 | rdp->n_rp_report_qs++; |
3838 | return 1; | 3838 | return 1; |
@@ -4155,7 +4155,7 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp) | |||
4155 | rdp->beenonline = true; /* We have now been online. */ | 4155 | rdp->beenonline = true; /* We have now been online. */ |
4156 | rdp->gpnum = rnp->completed; /* Make CPU later note any new GP. */ | 4156 | rdp->gpnum = rnp->completed; /* Make CPU later note any new GP. */ |
4157 | rdp->completed = rnp->completed; | 4157 | rdp->completed = rnp->completed; |
4158 | rdp->passed_quiesce = false; | 4158 | rdp->cpu_no_qs = true; |
4159 | rdp->rcu_qs_ctr_snap = per_cpu(rcu_qs_ctr, cpu); | 4159 | rdp->rcu_qs_ctr_snap = per_cpu(rcu_qs_ctr, cpu); |
4160 | rdp->core_needs_qs = false; | 4160 | rdp->core_needs_qs = false; |
4161 | trace_rcu_grace_period(rsp->name, rdp->gpnum, TPS("cpuonl")); | 4161 | trace_rcu_grace_period(rsp->name, rdp->gpnum, TPS("cpuonl")); |