]> Gentwo Git Trees - linux/.git/commit
cpuidle: governors: teo: Simplify intercepts-based state lookup
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 16 Nov 2025 12:35:14 +0000 (13:35 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 20 Nov 2025 15:32:48 +0000 (16:32 +0100)
commitd834e68a0e8b4a3c673eb96d4d53e48f3c19a81e
treea2b4082589e99b65abf63b14665ea5cdb5144c45
parent50db438231dcf7ceac187a6a9c68a1d757b8d883
cpuidle: governors: teo: Simplify intercepts-based state lookup

Simplify the loop looking up a candidate idle state in the case when an
intercept is likely to occur by adding a search for the state index limit
if the tick is stopped before it.

First, call tick_nohz_tick_stopped() just once and if it returns true,
look for the shallowest state index below the current candidate one with
target residency at least equal to the tick period length.

Next, simply look for a state that is not shallower than the one found
in the previous step and satisfies the intercepts majority condition (if
there are no such states, the shallowest state that is not shallower
than the one found in the previous step becomes the new candidate).

Since teo_state_ok() has no callers any more after the above changes,
drop it.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
[ rjw: Changelog clarification and code comment edit ]
Link: https://patch.msgid.link/2418792.ElGaqSPkdT@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/governors/teo.c