Skip to content
Commit 63f202e5 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

cpuidle: teo: Avoid using "early hits" incorrectly



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: 159e4856 ("cpuidle: teo: Fix "early hits" handling for disabled idle states")
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent b6495b7f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment