mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
lpm-levels: Don't stop the tick if it's not beneficial
There is no point in stopping the scheduler tick if the expected idle duration is shorter than the tick period length. Change-Id: I8d499c9b2dcf1cd3c8401cc2002ee8b485023ff0 Signed-off-by: Alexander Winkowski <dereference23@outlook.com> Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This commit is contained in:
parent
374cf03e25
commit
2fed88beb9
@ -488,6 +488,14 @@ static bool psci_enter_sleep(struct lpm_cpu *cpu, int idx, bool from_idle)
|
||||
static int lpm_cpuidle_select(struct cpuidle_driver *drv,
|
||||
struct cpuidle_device *dev, bool *stop_tick)
|
||||
{
|
||||
#ifdef CONFIG_NO_HZ_COMMON
|
||||
ktime_t delta_next;
|
||||
s64 duration_ns = tick_nohz_get_sleep_length(&delta_next);
|
||||
|
||||
if (duration_ns <= TICK_NSEC)
|
||||
*stop_tick = false;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user