diff options
| author | Len Brown <len.brown@intel.com> | 2007-10-10 00:32:13 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2007-10-10 00:32:13 -0400 |
| commit | de85871a9a53c00cae4c3a70849b5eaad0eb38b2 (patch) | |
| tree | e1f5ea71da333598db35a63a2c6faa1343037412 /kernel | |
| parent | 731aa5fd9971a5163845fbe55de63d686a11da0a (diff) | |
| parent | e196441bdf2dbf0526b28a6829c39557c236d611 (diff) | |
Pull cpuidle into test branch
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/time/tick-sched.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 8c3fef1db09c..637519af6151 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
| @@ -153,6 +153,7 @@ void tick_nohz_stop_sched_tick(void) | |||
| 153 | unsigned long seq, last_jiffies, next_jiffies, delta_jiffies, flags; | 153 | unsigned long seq, last_jiffies, next_jiffies, delta_jiffies, flags; |
| 154 | struct tick_sched *ts; | 154 | struct tick_sched *ts; |
| 155 | ktime_t last_update, expires, now, delta; | 155 | ktime_t last_update, expires, now, delta; |
| 156 | struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev; | ||
| 156 | int cpu; | 157 | int cpu; |
| 157 | 158 | ||
| 158 | local_irq_save(flags); | 159 | local_irq_save(flags); |
| @@ -302,11 +303,26 @@ void tick_nohz_stop_sched_tick(void) | |||
| 302 | out: | 303 | out: |
| 303 | ts->next_jiffies = next_jiffies; | 304 | ts->next_jiffies = next_jiffies; |
| 304 | ts->last_jiffies = last_jiffies; | 305 | ts->last_jiffies = last_jiffies; |
| 306 | ts->sleep_length = ktime_sub(dev->next_event, now); | ||
| 305 | end: | 307 | end: |
| 306 | local_irq_restore(flags); | 308 | local_irq_restore(flags); |
| 307 | } | 309 | } |
| 308 | 310 | ||
| 309 | /** | 311 | /** |
| 312 | * tick_nohz_get_sleep_length - return the length of the current sleep | ||
| 313 | * | ||
| 314 | * Called from power state control code with interrupts disabled | ||
| 315 | */ | ||
| 316 | ktime_t tick_nohz_get_sleep_length(void) | ||
| 317 | { | ||
| 318 | struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched); | ||
| 319 | |||
| 320 | return ts->sleep_length; | ||
| 321 | } | ||
| 322 | |||
| 323 | EXPORT_SYMBOL_GPL(tick_nohz_get_sleep_length); | ||
| 324 | |||
| 325 | /** | ||
| 310 | * nohz_restart_sched_tick - restart the idle tick from the idle task | 326 | * nohz_restart_sched_tick - restart the idle tick from the idle task |
| 311 | * | 327 | * |
| 312 | * Restart the idle tick when the CPU is woken up from idle | 328 | * Restart the idle tick when the CPU is woken up from idle |
