cpuidle: teo: Skip tick_nohz_get_sleep_length() call in some cases
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 3 Aug 2023 21:09:18 +0000 (23:09 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 9 Aug 2023 17:58:46 +0000 (19:58 +0200)
commit6da8f9ba5a87f8aecf2cd4441cc6024a77e5b645
tree594fecf72587e6aa3e86ddef92b3d2e0394dabd6
parent21d28cd2fa5fc01ee83e64df838ecd72112c09b7
cpuidle: teo: Skip tick_nohz_get_sleep_length() call in some cases

Make teo_select() avoid calling tick_nohz_get_sleep_length() if the
candidate idle state to return is state 0 or if state 0 is a polling
one and the target residency of the current candidate one is below
a certain threshold, in which cases it may be assumed that the CPU will
be woken up immediately by a non-timer wakeup source and the timers
are not likely to matter.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Tested-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
drivers/cpuidle/governors/teo.c