Re: [RFC][PATCH 4/9] idle: Fix rcu_idle_*() usage

From: Gautham R. Shenoy
Date: Mon May 23 2022 - 05:46:55 EST


On Thu, May 19, 2022 at 11:27:54PM +0200, Peter Zijlstra wrote:
> The whole disable-RCU, enable-IRQS dance is very intricate since
> changing IRQ state is traced, which depends on RCU.
>
> Add two helpers for the cpuidle case that mirror the entry code.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> ---

[...]
>
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -13,6 +13,7 @@
> #include <linux/mutex.h>
> #include <linux/sched.h>
> #include <linux/sched/clock.h>
> +#include <linux/sched/idle.h>
> #include <linux/notifier.h>
> #include <linux/pm_qos.h>
> #include <linux/cpu.h>
> @@ -150,12 +151,12 @@ static void enter_s2idle_proper(struct c
> */
> stop_critical_timings();
> if (!(target_state->flags & CPUIDLE_FLAG_RCU_IDLE))
> - rcu_idle_enter();
> + cpuidle_rcu_enter();
> target_state->enter_s2idle(dev, drv, index);
> if (WARN_ON_ONCE(!irqs_disabled()))
> - local_irq_disable();
> + raw_local_irq_disable();
> if (!(target_state->flags & CPUIDLE_FLAG_RCU_IDLE))
> - rcu_idle_exit();
> + cpuidle_rcu_enter();

Shouldn't this be cpuidle_rcu_exit() ?


> tick_unfreeze();
> start_critical_timings();
>

--
Thanks and Regards
gautham.