diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-09-28 21:19:24 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-12-04 15:27:29 -0500 |
commit | fecbf6f01fbd83e6419ccb7f61d9a6eb987f1d92 (patch) | |
tree | 3d16cf050eae5940f2ef115a5db601a66b3fe7c1 /kernel | |
parent | 47dbc90663f697a4515a8dd5c99ae43dba108cb4 (diff) |
rcu: Simplify rcu_sched_qs() control flow
This commit applies an early-exit approach to rcu_sched_qs(), reducing
the nesting level and saving a line of code.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rcu/tree.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 23df2661c899..ed3bc0578cc5 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -244,22 +244,21 @@ void rcu_sched_qs(void) | |||
244 | { | 244 | { |
245 | unsigned long flags; | 245 | unsigned long flags; |
246 | 246 | ||
247 | if (__this_cpu_read(rcu_sched_data.cpu_no_qs.s)) { | 247 | if (!__this_cpu_read(rcu_sched_data.cpu_no_qs.s)) |
248 | trace_rcu_grace_period(TPS("rcu_sched"), | 248 | return; |
249 | __this_cpu_read(rcu_sched_data.gpnum), | 249 | trace_rcu_grace_period(TPS("rcu_sched"), |
250 | TPS("cpuqs")); | 250 | __this_cpu_read(rcu_sched_data.gpnum), |
251 | __this_cpu_write(rcu_sched_data.cpu_no_qs.b.norm, false); | 251 | TPS("cpuqs")); |
252 | if (!__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp)) | 252 | __this_cpu_write(rcu_sched_data.cpu_no_qs.b.norm, false); |
253 | return; | 253 | if (!__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp)) |
254 | local_irq_save(flags); | 254 | return; |
255 | if (__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp)) { | 255 | local_irq_save(flags); |
256 | __this_cpu_write(rcu_sched_data.cpu_no_qs.b.exp, false); | 256 | if (__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp)) { |
257 | rcu_report_exp_rdp(&rcu_sched_state, | 257 | __this_cpu_write(rcu_sched_data.cpu_no_qs.b.exp, false); |
258 | this_cpu_ptr(&rcu_sched_data), | 258 | rcu_report_exp_rdp(&rcu_sched_state, |
259 | true); | 259 | this_cpu_ptr(&rcu_sched_data), true); |
260 | } | ||
261 | local_irq_restore(flags); | ||
262 | } | 260 | } |
261 | local_irq_restore(flags); | ||
263 | } | 262 | } |
264 | 263 | ||
265 | void rcu_bh_qs(void) | 264 | void rcu_bh_qs(void) |