RE: [PATCH 3/4] cpuidle: teo: Consider hits and misses metrics of disabled states

Doug Smythies
2019-11-05T19:50:46Z

On 2019.10.10 14:36 Rafael J. Wysocki wrote:

> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The TEO governor uses idle duration "bins" defined in accordance with
> the CPU idle states table provided by the driver, so that each "bin"
> covers the idle duration range between the target residency of the
> idle state corresponding to it and the target residency of the closest
> deeper idle state. The governor collects statistics for each bin
> regardless of whether or not the idle state corresponding to it is
> currently enabled.
>
> In particular, the "hits" and "misses" metrics measure the likelihood
> of a situation in which both the time till the next timer (sleep
> length) and the idle duration measured after wakeup fall into the
> given bin. Namely, if the "hits" value is greater than the "misses"
> one, that situation is more likely than the one in which the sleep
> length falls into the given bin, but the idle duration measured after
> wakeup falls into a bin corresponding to one of the shallower idle
> states.
>
> If the idle state corresponding to the given bin is disabled, it
> cannot be selected and if it turns out to be the one that should be
> selected, a shallower idle state needs to be used instead of it.
> Nevertheless, the metrics collected for the bin corresponding to it
> are still valid and need to be taken into account as though that
> state had not been disabled.
>
> For this reason, make teo_select() always use the "hits" and "misses"
> values of the idle duration range that the sleep length falls into
> even if the specific idle state corresponding to it is disabled and
> if the "hits" values is greater than the "misses" one, select the
> closest enabled shallower idle state in that case.
>
> Fixes: b26bf6ab716f ("cpuidle: New timer events oriented governor for tickless systems")
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Great thanks.

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