]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cpuidle: governors: menu: Refine stopped tick handling
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 23 Feb 2026 15:38:55 +0000 (16:38 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 5 Mar 2026 14:23:16 +0000 (15:23 +0100)
commite57c2bf2e89df3b176ab579abfd3ed54fd27034c
tree98a96ab3f89336c24958917d04c0f4e437848c1f
parent11439c4635edd669ae435eec308f4ab8a0804808
cpuidle: governors: menu: Refine stopped tick handling

This change is based on the observation that it is not in fact necessary
to select a deep idle state every time the scheduler tick has been
stopped before the idle state selection takes place.  Namely, if the
time till the closest timer (that is not the tick) is short enough,
a shallow idle state can be selected because the timer will kick the
CPU out of that state, so the damage from a possible overly optimistic
selection will be limited.

Update the menu governor in accordance with the above and use twice
the tick period length as the "safe timer range" for allowing the
original predicted_ns value to be used even if the tick has been
stopped.

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