All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpuidle: Drop misleading comments about RCU usage
@ 2020-09-22  9:15 ` Ulf Hansson
  0 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2020-09-22  9:15 UTC (permalink / raw)
  To: Rafael J . Wysocki, Daniel Lezcano, linux-pm
  Cc: Lina Iyer, Ulf Hansson, linux-arm-kernel, Peter Zijlstra

The commit 1098582a0f6c ("sched,idle,rcu: Push rcu_idle deeper into the
idle path"), moved the calls rcu_idle_enter|exit() into the cpuidle core.

However, it forgot to remove a couple of comments in enter_s2idle_proper()
about why RCU_NONIDLE earlier was needed. So, let's drop them as they have
become a bit misleading.

Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/cpuidle/cpuidle.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 6c7e5621cf9a..29e84687f3c3 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -142,11 +142,6 @@ static void enter_s2idle_proper(struct cpuidle_driver *drv,
 
 	time_start = ns_to_ktime(local_clock());
 
-	/*
-	 * trace_suspend_resume() called by tick_freeze() for the last CPU
-	 * executing it contains RCU usage regarded as invalid in the idle
-	 * context, so tell RCU about that.
-	 */
 	tick_freeze();
 	/*
 	 * The state used here cannot be a "coupled" one, because the "coupled"
@@ -159,11 +154,6 @@ static void enter_s2idle_proper(struct cpuidle_driver *drv,
 	target_state->enter_s2idle(dev, drv, index);
 	if (WARN_ON_ONCE(!irqs_disabled()))
 		local_irq_disable();
-	/*
-	 * timekeeping_resume() that will be called by tick_unfreeze() for the
-	 * first CPU executing it calls functions containing RCU read-side
-	 * critical sections, so tell RCU about that.
-	 */
 	if (!(target_state->flags & CPUIDLE_FLAG_RCU_IDLE))
 		rcu_idle_exit();
 	tick_unfreeze();
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] cpuidle: Drop misleading comments about RCU usage
@ 2020-09-22  9:15 ` Ulf Hansson
  0 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2020-09-22  9:15 UTC (permalink / raw)
  To: Rafael J . Wysocki, Daniel Lezcano, linux-pm
  Cc: Peter Zijlstra, Ulf Hansson, linux-arm-kernel, Lina Iyer

The commit 1098582a0f6c ("sched,idle,rcu: Push rcu_idle deeper into the
idle path"), moved the calls rcu_idle_enter|exit() into the cpuidle core.

However, it forgot to remove a couple of comments in enter_s2idle_proper()
about why RCU_NONIDLE earlier was needed. So, let's drop them as they have
become a bit misleading.

Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/cpuidle/cpuidle.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 6c7e5621cf9a..29e84687f3c3 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -142,11 +142,6 @@ static void enter_s2idle_proper(struct cpuidle_driver *drv,
 
 	time_start = ns_to_ktime(local_clock());
 
-	/*
-	 * trace_suspend_resume() called by tick_freeze() for the last CPU
-	 * executing it contains RCU usage regarded as invalid in the idle
-	 * context, so tell RCU about that.
-	 */
 	tick_freeze();
 	/*
 	 * The state used here cannot be a "coupled" one, because the "coupled"
@@ -159,11 +154,6 @@ static void enter_s2idle_proper(struct cpuidle_driver *drv,
 	target_state->enter_s2idle(dev, drv, index);
 	if (WARN_ON_ONCE(!irqs_disabled()))
 		local_irq_disable();
-	/*
-	 * timekeeping_resume() that will be called by tick_unfreeze() for the
-	 * first CPU executing it calls functions containing RCU read-side
-	 * critical sections, so tell RCU about that.
-	 */
 	if (!(target_state->flags & CPUIDLE_FLAG_RCU_IDLE))
 		rcu_idle_exit();
 	tick_unfreeze();
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] cpuidle: Drop misleading comments about RCU usage
  2020-09-22  9:15 ` Ulf Hansson
@ 2020-09-22 17:34   ` Rafael J. Wysocki
  -1 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2020-09-22 17:34 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J . Wysocki, Daniel Lezcano, Linux PM, Lina Iyer,
	Linux ARM, Peter Zijlstra

On Tue, Sep 22, 2020 at 11:16 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> The commit 1098582a0f6c ("sched,idle,rcu: Push rcu_idle deeper into the
> idle path"), moved the calls rcu_idle_enter|exit() into the cpuidle core.
>
> However, it forgot to remove a couple of comments in enter_s2idle_proper()
> about why RCU_NONIDLE earlier was needed. So, let's drop them as they have
> become a bit misleading.
>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Applied as 5.9-rc7 material, thanks!

> ---
>  drivers/cpuidle/cpuidle.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index 6c7e5621cf9a..29e84687f3c3 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -142,11 +142,6 @@ static void enter_s2idle_proper(struct cpuidle_driver *drv,
>
>         time_start = ns_to_ktime(local_clock());
>
> -       /*
> -        * trace_suspend_resume() called by tick_freeze() for the last CPU
> -        * executing it contains RCU usage regarded as invalid in the idle
> -        * context, so tell RCU about that.
> -        */
>         tick_freeze();
>         /*
>          * The state used here cannot be a "coupled" one, because the "coupled"
> @@ -159,11 +154,6 @@ static void enter_s2idle_proper(struct cpuidle_driver *drv,
>         target_state->enter_s2idle(dev, drv, index);
>         if (WARN_ON_ONCE(!irqs_disabled()))
>                 local_irq_disable();
> -       /*
> -        * timekeeping_resume() that will be called by tick_unfreeze() for the
> -        * first CPU executing it calls functions containing RCU read-side
> -        * critical sections, so tell RCU about that.
> -        */
>         if (!(target_state->flags & CPUIDLE_FLAG_RCU_IDLE))
>                 rcu_idle_exit();
>         tick_unfreeze();
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cpuidle: Drop misleading comments about RCU usage
@ 2020-09-22 17:34   ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2020-09-22 17:34 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Linux PM, Peter Zijlstra, Daniel Lezcano, Rafael J . Wysocki,
	Lina Iyer, Linux ARM

On Tue, Sep 22, 2020 at 11:16 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> The commit 1098582a0f6c ("sched,idle,rcu: Push rcu_idle deeper into the
> idle path"), moved the calls rcu_idle_enter|exit() into the cpuidle core.
>
> However, it forgot to remove a couple of comments in enter_s2idle_proper()
> about why RCU_NONIDLE earlier was needed. So, let's drop them as they have
> become a bit misleading.
>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Applied as 5.9-rc7 material, thanks!

> ---
>  drivers/cpuidle/cpuidle.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index 6c7e5621cf9a..29e84687f3c3 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -142,11 +142,6 @@ static void enter_s2idle_proper(struct cpuidle_driver *drv,
>
>         time_start = ns_to_ktime(local_clock());
>
> -       /*
> -        * trace_suspend_resume() called by tick_freeze() for the last CPU
> -        * executing it contains RCU usage regarded as invalid in the idle
> -        * context, so tell RCU about that.
> -        */
>         tick_freeze();
>         /*
>          * The state used here cannot be a "coupled" one, because the "coupled"
> @@ -159,11 +154,6 @@ static void enter_s2idle_proper(struct cpuidle_driver *drv,
>         target_state->enter_s2idle(dev, drv, index);
>         if (WARN_ON_ONCE(!irqs_disabled()))
>                 local_irq_disable();
> -       /*
> -        * timekeeping_resume() that will be called by tick_unfreeze() for the
> -        * first CPU executing it calls functions containing RCU read-side
> -        * critical sections, so tell RCU about that.
> -        */
>         if (!(target_state->flags & CPUIDLE_FLAG_RCU_IDLE))
>                 rcu_idle_exit();
>         tick_unfreeze();
> --
> 2.25.1
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-22 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22  9:15 [PATCH] cpuidle: Drop misleading comments about RCU usage Ulf Hansson
2020-09-22  9:15 ` Ulf Hansson
2020-09-22 17:34 ` Rafael J. Wysocki
2020-09-22 17:34   ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.