From fd064b9b7770d5c7705bf9542950c7bd81c30f98 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 16 Feb 2007 01:27:47 -0800 Subject: [PATCH] Extend next_timer_interrupt() to use a reference jiffie For CONFIG_NO_HZ we need to calculate the next timer wheel event based on a given jiffie value. Extend the existing code to allow the extra 'now' argument. Provide a compability function for the existing implementations to call the function with now == jiffies. (This also solves the racyness of the original code vs. jiffies changing during the iteration.) No functional changes to existing users of this infrastructure. [ remove WARN_ON() that triggered on s390, by Carsten Otte ] [ made new helper static, Adrian Bunk ] Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Cc: john stultz Cc: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/timer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/linux/timer.h') diff --git a/include/linux/timer.h b/include/linux/timer.h index fb5edaaf0eb..bd0af324fd4 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -61,7 +61,17 @@ extern int del_timer(struct timer_list * timer); extern int __mod_timer(struct timer_list *timer, unsigned long expires); extern int mod_timer(struct timer_list *timer, unsigned long expires); +/* + * Return when the next timer-wheel timeout occurs (in absolute jiffies), + * locks the timer base: + */ extern unsigned long next_timer_interrupt(void); +/* + * Return when the next timer-wheel timeout occurs (in absolute jiffies), + * locks the timer base and does the comparison against the given + * jiffie. + */ +extern unsigned long get_next_timer_interrupt(unsigned long now); /** * add_timer - start a timer -- cgit v1.2.3