Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48578
b: refs/heads/master
c: fd064b9
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Linus Torvalds committed Feb 16, 2007
1 parent 8c79ec8 commit 6acab75
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1cfd68496e53f7be09a3c1358d1d389004217541
refs/heads/master: fd064b9b7770d5c7705bf9542950c7bd81c30f98
10 changes: 10 additions & 0 deletions trunk/include/linux/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
}
EXPORT_SYMBOL_GPL(hrtimer_get_remaining);

#ifdef CONFIG_NO_IDLE_HZ
#if defined(CONFIG_NO_IDLE_HZ) || defined(CONFIG_NO_HZ)
/**
* hrtimer_get_next_event - get the time until next expiry event
*
Expand Down
14 changes: 11 additions & 3 deletions trunk/kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ static inline void __run_timers(tvec_base_t *base)
spin_unlock_irq(&base->lock);
}

#ifdef CONFIG_NO_IDLE_HZ
#if defined(CONFIG_NO_IDLE_HZ) || defined(CONFIG_NO_HZ)
/*
* Find out when the next timer event is due to happen. This
* is used on S/390 to stop all activity when a cpus is idle.
Expand Down Expand Up @@ -687,10 +687,10 @@ static unsigned long cmp_next_hrtimer_event(unsigned long now,
/**
* next_timer_interrupt - return the jiffy of the next pending timer
*/
unsigned long next_timer_interrupt(void)
unsigned long get_next_timer_interrupt(unsigned long now)
{
tvec_base_t *base = __get_cpu_var(tvec_bases);
unsigned long expires, now = jiffies;
unsigned long expires;

spin_lock(&base->lock);
expires = __next_timer_interrupt(base);
Expand All @@ -701,6 +701,14 @@ unsigned long next_timer_interrupt(void)

return cmp_next_hrtimer_event(now, expires);
}

#ifdef CONFIG_NO_IDLE_HZ
unsigned long next_timer_interrupt(void)
{
return get_next_timer_interrupt(jiffies);
}
#endif

#endif

/******************************************************************/
Expand Down

0 comments on commit 6acab75

Please sign in to comment.