Re: [PATCH 6/6] cpuidle: Fix poll_idle() noinstr annotation

2023-01-24 Thread Rafael J. Wysocki
On Mon, Jan 23, 2023 at 9:58 PM Peter Zijlstra  wrote:
>
> 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()")
> Signed-off-by: Peter Zijlstra (Intel) 
> Reported-by: kernel test robot 
> Link: 
> https://lore.kernel.org/oe-lkp/202301192148.58ece903-oliver.s...@intel.com

Acked-by: Rafael J. Wysocki 

> ---
>  drivers/cpuidle/cpuidle.c|2 +-
>  drivers/cpuidle/poll_state.c |2 --
>  2 files changed, 1 insertion(+), 3 deletions(-)
>
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -426,7 +426,7 @@ void cpuidle_reflect(struct cpuidle_devi
>   * @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;
> --- a/drivers/cpuidle/poll_state.c
> +++ b/drivers/cpuidle/poll_state.c
> @@ -15,7 +15,6 @@ static int __cpuidle poll_idle(struct cp
>  {
> u64 time_start;
>
> -   instrumentation_begin();
> time_start = local_clock();
>
> dev->poll_time_limit = false;
> @@ -42,7 +41,6 @@ static int __cpuidle poll_idle(struct cp
> raw_local_irq_disable();
>
> current_clr_polling();
> -   instrumentation_end();
>
> return index;
>  }
>
>
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


[PATCH 6/6] cpuidle: Fix poll_idle() noinstr annotation

2023-01-23 Thread Peter Zijlstra
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()")
Signed-off-by: Peter Zijlstra (Intel) 
Reported-by: kernel test robot 
Link: https://lore.kernel.org/oe-lkp/202301192148.58ece903-oliver.s...@intel.com
---
 drivers/cpuidle/cpuidle.c|2 +-
 drivers/cpuidle/poll_state.c |2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -426,7 +426,7 @@ void cpuidle_reflect(struct cpuidle_devi
  * @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;
--- a/drivers/cpuidle/poll_state.c
+++ b/drivers/cpuidle/poll_state.c
@@ -15,7 +15,6 @@ static int __cpuidle poll_idle(struct cp
 {
u64 time_start;
 
-   instrumentation_begin();
time_start = local_clock();
 
dev->poll_time_limit = false;
@@ -42,7 +41,6 @@ static int __cpuidle poll_idle(struct cp
raw_local_irq_disable();
 
current_clr_polling();
-   instrumentation_end();
 
return index;
 }


___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization