diff mbox series

[2/6] cpuidle: teo: Don't stop tick on utilized

Message ID 20240606090050.327614-3-christian.loehle@arm.com
State New
Headers show
Series cpuidle: teo: fixes and improvements | expand

Commit Message

Christian Loehle June 6, 2024, 9 a.m. UTC
As we expect to be woken up early, stopping the tick is likely to be
a waste.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
---
 drivers/cpuidle/governors/teo.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c
index 45f43e2ee02d..2c427dd4cac0 100644
--- a/drivers/cpuidle/governors/teo.c
+++ b/drivers/cpuidle/governors/teo.c
@@ -429,10 +429,13 @@  static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
 			idx = 0;
 			goto out_tick;
 		}
-		/* Assume that state 1 is not a polling one and use it. */
+		/*
+		 * Assume that state 1 is not a polling one and use it, but
+		 * don't stop the tick as we expect to be woken up early.
+		 */
 		idx = 1;
 		duration_ns = drv->states[1].target_residency_ns;
-		goto end;
+		goto out_tick_state;
 	}
 
 	/* Compute the sums of metrics for early wakeup pattern detection. */
@@ -618,6 +621,7 @@  static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
 	    duration_ns >= TICK_NSEC) || tick_nohz_tick_stopped())
 		return idx;
 
+out_tick_state:
 	/*
 	 * The tick is not going to be stopped, so if the target residency of
 	 * the state to be returned is not within the time till the closest