cpuidle: Fix poll_idle() noinstr annotation
authorPeter Zijlstra <peterz@infradead.org>
Thu, 26 Jan 2023 15:08:38 +0000 (16:08 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 31 Jan 2023 14:01:47 +0000 (15:01 +0100)
The instrumentation_begin()/end() annotations in poll_idle() were
complete nonsense. Specifically they caused tracing to happen in the
middle of noinstr code, resulting in RCU splats.

Now that local_clock() is noinstr, mark up the rest and let it rip.

Fixes: 00717eb8c955 ("cpuidle: Annotate poll_idle()")
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/oe-lkp/202301192148.58ece903-oliver.sang@intel.com
Link: https://lore.kernel.org/r/20230126151323.819534689@infradead.org
drivers/cpuidle/cpuidle.c
drivers/cpuidle/poll_state.c

index 500d1720421eaa5706dbd4fc5324ce1ca619e95b..0b00f21cefe36fa7a3666956209063e326d84139 100644 (file)
@@ -426,7 +426,7 @@ void cpuidle_reflect(struct cpuidle_device *dev, int index)
  * @dev:   the cpuidle device
  *
  */
-u64 cpuidle_poll_time(struct cpuidle_driver *drv,
+__cpuidle u64 cpuidle_poll_time(struct cpuidle_driver *drv,
                      struct cpuidle_device *dev)
 {
        int i;
index d25ec52846e65ca41157dfb9bdb673bcb196fb41..bdcfeaecd2282ca1f250a829bfd302554860a93e 100644 (file)
@@ -15,7 +15,6 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,
 {
        u64 time_start;
 
-       instrumentation_begin();
        time_start = local_clock();
 
        dev->poll_time_limit = false;
@@ -42,7 +41,6 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,
        raw_local_irq_disable();
 
        current_clr_polling();
-       instrumentation_end();
 
        return index;
 }