diff options
-rw-r--r-- | include/linux/timer.h | 10 | ||||
-rw-r--r-- | kernel/hrtimer.c | 2 | ||||
-rw-r--r-- | kernel/timer.c | 14 |
3 files changed, 22 insertions, 4 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h index fb5edaaf0ebd..bd0af324fd48 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -61,7 +61,17 @@ extern int del_timer(struct timer_list * timer); | |||
61 | extern int __mod_timer(struct timer_list *timer, unsigned long expires); | 61 | extern int __mod_timer(struct timer_list *timer, unsigned long expires); |
62 | extern int mod_timer(struct timer_list *timer, unsigned long expires); | 62 | extern int mod_timer(struct timer_list *timer, unsigned long expires); |
63 | 63 | ||
64 | /* | ||
65 | * Return when the next timer-wheel timeout occurs (in absolute jiffies), | ||
66 | * locks the timer base: | ||
67 | */ | ||
64 | extern unsigned long next_timer_interrupt(void); | 68 | extern unsigned long next_timer_interrupt(void); |
69 | /* | ||
70 | * Return when the next timer-wheel timeout occurs (in absolute jiffies), | ||
71 | * locks the timer base and does the comparison against the given | ||
72 | * jiffie. | ||
73 | */ | ||
74 | extern unsigned long get_next_timer_interrupt(unsigned long now); | ||
65 | 75 | ||
66 | /** | 76 | /** |
67 | * add_timer - start a timer | 77 | * add_timer - start a timer |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index c0fdb9b6d296..bd57ef403049 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -533,7 +533,7 @@ ktime_t hrtimer_get_remaining(const struct hrtimer *timer) | |||
533 | } | 533 | } |
534 | EXPORT_SYMBOL_GPL(hrtimer_get_remaining); | 534 | EXPORT_SYMBOL_GPL(hrtimer_get_remaining); |
535 | 535 | ||
536 | #ifdef CONFIG_NO_IDLE_HZ | 536 | #if defined(CONFIG_NO_IDLE_HZ) || defined(CONFIG_NO_HZ) |
537 | /** | 537 | /** |
538 | * hrtimer_get_next_event - get the time until next expiry event | 538 | * hrtimer_get_next_event - get the time until next expiry event |
539 | * | 539 | * |
diff --git a/kernel/timer.c b/kernel/timer.c index 201bee07b8e0..6d843e100e75 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -591,7 +591,7 @@ static inline void __run_timers(tvec_base_t *base) | |||
591 | spin_unlock_irq(&base->lock); | 591 | spin_unlock_irq(&base->lock); |
592 | } | 592 | } |
593 | 593 | ||
594 | #ifdef CONFIG_NO_IDLE_HZ | 594 | #if defined(CONFIG_NO_IDLE_HZ) || defined(CONFIG_NO_HZ) |
595 | /* | 595 | /* |
596 | * Find out when the next timer event is due to happen. This | 596 | * Find out when the next timer event is due to happen. This |
597 | * is used on S/390 to stop all activity when a cpus is idle. | 597 | * is used on S/390 to stop all activity when a cpus is idle. |
@@ -687,10 +687,10 @@ static unsigned long cmp_next_hrtimer_event(unsigned long now, | |||
687 | /** | 687 | /** |
688 | * next_timer_interrupt - return the jiffy of the next pending timer | 688 | * next_timer_interrupt - return the jiffy of the next pending timer |
689 | */ | 689 | */ |
690 | unsigned long next_timer_interrupt(void) | 690 | unsigned long get_next_timer_interrupt(unsigned long now) |
691 | { | 691 | { |
692 | tvec_base_t *base = __get_cpu_var(tvec_bases); | 692 | tvec_base_t *base = __get_cpu_var(tvec_bases); |
693 | unsigned long expires, now = jiffies; | 693 | unsigned long expires; |
694 | 694 | ||
695 | spin_lock(&base->lock); | 695 | spin_lock(&base->lock); |
696 | expires = __next_timer_interrupt(base); | 696 | expires = __next_timer_interrupt(base); |
@@ -701,6 +701,14 @@ unsigned long next_timer_interrupt(void) | |||
701 | 701 | ||
702 | return cmp_next_hrtimer_event(now, expires); | 702 | return cmp_next_hrtimer_event(now, expires); |
703 | } | 703 | } |
704 | |||
705 | #ifdef CONFIG_NO_IDLE_HZ | ||
706 | unsigned long next_timer_interrupt(void) | ||
707 | { | ||
708 | return get_next_timer_interrupt(jiffies); | ||
709 | } | ||
710 | #endif | ||
711 | |||
704 | #endif | 712 | #endif |
705 | 713 | ||
706 | /******************************************************************/ | 714 | /******************************************************************/ |