]> git.ipfire.org Git - thirdparty/linux.git/commit
cpuidle: governors: teo: Adjust the classification of wakeup events
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 29 Jan 2026 20:49:12 +0000 (21:49 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 30 Jan 2026 19:15:43 +0000 (20:15 +0100)
commitf36de72673ad80c9931c0b411df0d6ef184f6c22
tree0c3b342099aa87e1943a3f4fe23e4fed205ac92f
parent475ca3470b3739150720f1b285646de38103e7b7
cpuidle: governors: teo: Adjust the classification of wakeup events

If differences between target residency values of adjacent idle states
of a given CPU are relatively large, the corresponding idle state bins
used by the teo governors are large either and the rule by which hits
are distinguished from intercepts is inaccurate.

Namely, by that rule, a wakeup event is classified as a hit if the
sleep length (the time till the closest timer other than the tick)
and the measured idle duration, adjusted for the entered idle state
exit latency, fall into the same idle state bin.  However, if that bin
is large enough, the actual difference between the sleep length and
the measured idle duration may be significant.  It may in fact be
significantly greater than the analogous difference for an event where
the sleep length and the measured idle duration fall into different
bins.

For this reason, amend the rule in question with a check that will only
allow a wakeup event to be counted as a hit if the sleep length is less
than the "raw" measured idle duration (which means that the wakeup
appears to have occurred after the anticipated timer event).  Otherwise,
the event will be counted as an intercept.

Also update the documentation part explaining the difference between
"hits" and "intercepts" to take the above change into account.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/5093379.31r3eYUQgx@rafael.j.wysocki
drivers/cpuidle/governors/teo.c