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

From: Christian Loehle
Date: Thu Jun 06 2024 - 05:06:06 EST


As we expect to be woken up early, stopping the tick is likely to be
a waste.

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

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
--
2.34.1