Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cascardo/linux.git] / kernel / sched / idle.c
index 594275e..8f177c7 100644 (file)
@@ -83,10 +83,13 @@ void __weak arch_cpu_idle(void)
  */
 void default_idle_call(void)
 {
-       if (current_clr_polling_and_test())
+       if (current_clr_polling_and_test()) {
                local_irq_enable();
-       else
+       } else {
+               stop_critical_timings();
                arch_cpu_idle();
+               start_critical_timings();
+       }
 }
 
 static int call_cpuidle(struct cpuidle_driver *drv, struct cpuidle_device *dev,
@@ -140,12 +143,6 @@ static void cpuidle_idle_call(void)
                return;
        }
 
-       /*
-        * During the idle period, stop measuring the disabled irqs
-        * critical sections latencies
-        */
-       stop_critical_timings();
-
        /*
         * Tell the RCU framework we are entering an idle section,
         * so no more rcu read side critical sections and one more
@@ -198,7 +195,6 @@ exit_idle:
                local_irq_enable();
 
        rcu_idle_exit();
-       start_critical_timings();
 }
 
 DEFINE_PER_CPU(bool, cpu_dead_idle);