Commit ed6694a6 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Treehugger Robot
Browse files

UPSTREAM: cpuidle: teo: Update idle duration estimate when choosing shallower state

The TEO governor takes CPU utilization into account by refining idle state
selection when the utilization is above a certain threshold.  This is done by
choosing an idle state shallower than the previously selected one.

However, when doing this, the idle duration estimate needs to be
adjusted so as to prevent the scheduler tick from being stopped when the
candidate idle state is shallow, which may lead to excessive energy
usage if the CPU is not woken up quickly enough going forward.
Moreover, if the scheduler tick has been stopped already and the new
idle duration estimate is too small, the replacement candidate state
cannot be used.

Modify the relevant code to take the above observations into account.

Bug: 254441685
Fixes: 9ce0f7c4 ("cpuidle: teo: Introduce util-awareness")
Link: https://lore.kernel.org/linux-pm/CAJZ5v0jJxHj65r2HXBTd3wfbZtsg=_StzwO1kA5STDnaPe_dWA@mail.gmail.com


Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-and-tested-by: default avatarKajetan Puchalski <kajetan.puchalski@arm.com>
(cherry picked from commit 3f0b0966)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I4f944d1b825f721dae7c406c73bac2a683d94cd6
parent d8e99e1a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment