mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
hrtimer: peek at the timer queue just before going idle
As part of going idle, we already look at the time of the next timer event to determine which C-state to select etc. This patch adds functionality that causes the timers that are past their soft expire time, to fire at this time, before we calculate the next wakeup time. This functionality will thus avoid wakeups by running timers before going idle rather than specially waking up for it. Signed-off-by: Arjan van de Ven <[email protected]>
This commit is contained in:
parent
ae4b748e81
commit
2e94d1f71f
3 changed files with 42 additions and 0 deletions
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/cpu.h>
|
||||
#include <linux/cpuidle.h>
|
||||
#include <linux/ktime.h>
|
||||
#include <linux/hrtimer.h>
|
||||
|
||||
#include "cpuidle.h"
|
||||
|
||||
|
|
@ -60,6 +61,12 @@ static void cpuidle_idle_call(void)
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* run any timers that can be run now, at this point
|
||||
* before calculating the idle duration etc.
|
||||
*/
|
||||
hrtimer_peek_ahead_timers();
|
||||
|
||||
/* ask the governor for the next state */
|
||||
next_state = cpuidle_curr_governor->select(dev);
|
||||
if (need_resched())
|
||||
|
|
|
|||
Loading…
Reference in a new issue