Commit fecbf6f0 authored by Paul E. McKenney's avatar Paul E. McKenney

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: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 47dbc906
...@@ -244,22 +244,21 @@ void rcu_sched_qs(void) ...@@ -244,22 +244,21 @@ 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))
trace_rcu_grace_period(TPS("rcu_sched"), return;
__this_cpu_read(rcu_sched_data.gpnum), trace_rcu_grace_period(TPS("rcu_sched"),
TPS("cpuqs")); __this_cpu_read(rcu_sched_data.gpnum),
__this_cpu_write(rcu_sched_data.cpu_no_qs.b.norm, false); TPS("cpuqs"));
if (!__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp)) __this_cpu_write(rcu_sched_data.cpu_no_qs.b.norm, false);
return; if (!__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp))
local_irq_save(flags); return;
if (__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp)) { local_irq_save(flags);
__this_cpu_write(rcu_sched_data.cpu_no_qs.b.exp, false); if (__this_cpu_read(rcu_sched_data.cpu_no_qs.b.exp)) {
rcu_report_exp_rdp(&rcu_sched_state, __this_cpu_write(rcu_sched_data.cpu_no_qs.b.exp, false);
this_cpu_ptr(&rcu_sched_data), rcu_report_exp_rdp(&rcu_sched_state,
true); this_cpu_ptr(&rcu_sched_data), true);
}
local_irq_restore(flags);
} }
local_irq_restore(flags);
} }
void rcu_bh_qs(void) void rcu_bh_qs(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment