1
0
Fork 0
alistair23-linux/drivers/cpuidle/governors
Rafael J. Wysocki f42407a790 cpuidle: teo: Avoid using "early hits" incorrectly
[ Upstream commit 63f202e5ed ]

If the current state with the maximum "early hits" metric in
teo_select() is also the one "matching" the expected idle duration,
it will be used as the candidate one for selection even if its
"misses" metric is greater than its "hits" metric, which is not
correct.

In that case, the candidate state should be shallower than the
current one and its "early hits" metric should be the maximum
among the idle states shallower than the current one.

To make that happen, modify teo_select() to save the index of
the state whose "early hits" metric is the maximum for the
range of states below the current one and go back to that state
if it turns out that the current one should be rejected.

Fixes: 159e48560f ("cpuidle: teo: Fix "early hits" handling for disabled idle states")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-05 21:22:52 +00:00
..
Makefile cpuidle: add haltpoll governor 2019-07-30 17:27:37 +02:00
haltpoll.c cpuidle-haltpoll: set haltpoll as preferred governor 2019-09-11 17:36:30 +02:00
ladder.c governors: unify last_state_idx 2019-07-30 17:27:37 +02:00
menu.c cpuidle: menu: Allow tick to be stopped if PM QoS is used 2019-08-05 11:02:44 +02:00
teo.c cpuidle: teo: Avoid using "early hits" incorrectly 2020-02-05 21:22:52 +00:00