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>
This commit is contained in:
Paul E. McKenney 2015-09-28 18:19:24 -07:00
parent 47dbc90663
commit fecbf6f01f

View File

@ -244,7 +244,8 @@ void rcu_sched_qs(void)
{ {
unsigned long flags; unsigned long flags;
if (__this_cpu_read(rcu_sched_data.cpu_no_qs.s)) { if (!__this_cpu_read(rcu_sched_data.cpu_no_qs.s))
return;
trace_rcu_grace_period(TPS("rcu_sched"), trace_rcu_grace_period(TPS("rcu_sched"),
__this_cpu_read(rcu_sched_data.gpnum), __this_cpu_read(rcu_sched_data.gpnum),
TPS("cpuqs")); TPS("cpuqs"));
@ -255,12 +256,10 @@ void rcu_sched_qs(void)
if (__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp)) { if (__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp)) {
__this_cpu_write(rcu_sched_data.cpu_no_qs.b.exp, false); __this_cpu_write(rcu_sched_data.cpu_no_qs.b.exp, false);
rcu_report_exp_rdp(&rcu_sched_state, rcu_report_exp_rdp(&rcu_sched_state,
this_cpu_ptr(&rcu_sched_data), this_cpu_ptr(&rcu_sched_data), true);
true);
} }
local_irq_restore(flags); local_irq_restore(flags);
} }
}
void rcu_bh_qs(void) void rcu_bh_qs(void)
{ {