static void rcu_prepare_for_idle(int cpu)
{
int c = 0;
+ unsigned long flags;
+
+ local_irq_save(flags);
/*
* If there are no callbacks on this CPU or if RCU has no further
if (!rcu_cpu_has_callbacks(cpu)) {
per_cpu(rcu_dyntick_holdoff, cpu) = jiffies - 1;
per_cpu(rcu_dyntick_drain, cpu) = 0;
+ per_cpu(rcu_awake_at_gp_end, cpu) = 0;
+ local_irq_restore(flags);
trace_rcu_prep_idle("No callbacks");
return;
}
if (!rcu_pending(cpu)) {
- trace_rcu_prep_idle("Dyntick with callbacks");
per_cpu(rcu_dyntick_holdoff, cpu) = jiffies - 1;
per_cpu(rcu_dyntick_drain, cpu) = 0;
per_cpu(rcu_awake_at_gp_end, cpu) = 1;
+ local_irq_restore(flags);
+ trace_rcu_prep_idle("Dyntick with callbacks");
return; /* Nothing to do immediately. */
}
* refrained from disabling the scheduling-clock tick.
*/
if (per_cpu(rcu_dyntick_holdoff, cpu) == jiffies) {
+ local_irq_restore(flags);
trace_rcu_prep_idle("In holdoff");
return;
}
if (per_cpu(rcu_dyntick_drain, cpu) <= 0) {
/* First time through, initialize the counter. */
per_cpu(rcu_dyntick_drain, cpu) = RCU_NEEDS_CPU_FLUSHES;
+ per_cpu(rcu_awake_at_gp_end, cpu) = 0;
} else if (--per_cpu(rcu_dyntick_drain, cpu) <= 0) {
/* We have hit the limit, so time to give up. */
per_cpu(rcu_dyntick_holdoff, cpu) = jiffies;
+ local_irq_restore(flags);
trace_rcu_prep_idle("Begin holdoff");
invoke_rcu_core(); /* Force the CPU out of dyntick-idle. */
return;
* So try forcing the callbacks through the grace period.
*/
if (c) {
+ local_irq_restore(flags);
trace_rcu_prep_idle("More callbacks");
invoke_rcu_core();
- } else
+ } else {
+ local_irq_restore(flags);
trace_rcu_prep_idle("Callbacks drained");
+ }
}
/*