summaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/cpuidle.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-09-10 16:06:00 -0700
committerArjan van de Ven <arjan@linux.intel.com>2008-09-11 07:17:49 -0700
commit2e94d1f71f7e4404d997e6fb4f1618aa147d76f9 (patch)
tree73958a61dffff311cdcdc8edcb7e6a4953150601 /drivers/cpuidle/cpuidle.c
parentae4b748e81b7e366f04f55229d5e372e372c33af (diff)
downloadlinux-2e94d1f71f7e4404d997e6fb4f1618aa147d76f9.tar.gz
linux-2e94d1f71f7e4404d997e6fb4f1618aa147d76f9.tar.bz2
linux-2e94d1f71f7e4404d997e6fb4f1618aa147d76f9.zip
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 <arjan@linux.intel.com>
Diffstat (limited to 'drivers/cpuidle/cpuidle.c')
-rw-r--r--drivers/cpuidle/cpuidle.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 5ce07b517c58..2e3148499368 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -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())