Re: [PATCH v1 3/5] cpuidle: governors: teo: Refine tick_intercepts vs total events check

From: Christian Loehle

Date: Wed Jan 21 2026 - 08:45:15 EST


On 1/14/26 19:45, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> Use 2/3 as the proportion coefficient in the check comparing
> cpu_data->tick_intercepts with cpu_data->total because it is close
> enough to the current one (5/8) and it allows of more straightforward
> interpretation (on average, intercepts within the tick period length
> are twice as frequent as other events).
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> ---
> drivers/cpuidle/governors/teo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/cpuidle/governors/teo.c
> +++ b/drivers/cpuidle/governors/teo.c
> @@ -485,7 +485,7 @@ constraint:
> * total wakeup events, do not stop the tick.
> */
> if (drv->states[idx].target_residency_ns < TICK_NSEC &&
> - cpu_data->tick_intercepts > cpu_data->total / 2 + cpu_data->total / 8)
> + 3 * cpu_data->tick_intercepts >= 2 * cpu_data->total)
> duration_ns = TICK_NSEC / 2;
>

Sure, I guess the 2 and 8 was just as arbitrary to avoid a division.

Reviewed-by: Christian Loehle <christian.loehle@xxxxxxx>