diff mbox series

[1/4] cpuidle: teo: Ignore disabled idle states that are too deep

Message ID 6803360.ubpITS43T2@kreacher (mailing list archive)
State Mainlined, archived
Headers show
Series cpuidle: teo: Fix issues related to disabled idle states | expand

Commit Message

Rafael J. Wysocki Oct. 10, 2019, 9:32 p.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Prevent disabled CPU idle state with target residencies beyond the
anticipated idle duration from being taken into account by the TEO
governor.

Fixes: b26bf6ab716f ("cpuidle: New timer events oriented governor for tickless systems")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/cpuidle/governors/teo.c |    7 +++++++
 1 file changed, 7 insertions(+)

Comments

Doug Smythies Nov. 5, 2019, 7:50 p.m. UTC | #1
On 2019.10.10 14:32 Rafael J. Wysocki wrote:

> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Prevent disabled CPU idle state with target residencies beyond the
> anticipated idle duration from being taken into account by the TEO
> governor.
> 
> Fixes: b26bf6ab716f ("cpuidle: New timer events oriented governor for tickless systems")
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---

Acked-by: Doug Smythies <dsmythies@telus.net>
diff mbox series

Patch

Index: linux-pm/drivers/cpuidle/governors/teo.c
===================================================================
--- linux-pm.orig/drivers/cpuidle/governors/teo.c
+++ linux-pm/drivers/cpuidle/governors/teo.c
@@ -258,6 +258,13 @@  static int teo_select(struct cpuidle_dri
 
 		if (s->disabled || su->disable) {
 			/*
+			 * Ignore disabled states with target residencies beyond
+			 * the anticipated idle duration.
+			 */
+			if (s->target_residency > duration_us)
+				continue;
+
+			/*
 			 * If the "early hits" metric of a disabled state is
 			 * greater than the current maximum, it should be taken
 			 * into account, because it would be a mistake to select