mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
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
20 lines
570 B
C
20 lines
570 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/* Common definitions for cpuidle governors. */
|
|
|
|
#ifndef __CPUIDLE_GOVERNOR_H
|
|
#define __CPUIDLE_GOVERNOR_H
|
|
|
|
/*
|
|
* Idle state target residency threshold used for deciding whether or not to
|
|
* check the time till the closest expected timer event.
|
|
*/
|
|
#define RESIDENCY_THRESHOLD_NS (15 * NSEC_PER_USEC)
|
|
/*
|
|
* If the closest timer is in this range, the governor idle state selection need
|
|
* not be adjusted after the scheduler tick has been stopped.
|
|
*/
|
|
#define SAFE_TIMER_RANGE_NS (2 * TICK_NSEC)
|
|
|
|
#endif /* __CPUIDLE_GOVERNOR_H */
|