Skip to content

Commit

Permalink
Merge branches 'timers/new-apis', 'timers/ntp' and 'timers/urgent' in…
Browse files Browse the repository at this point in the history
…to timers/core
  • Loading branch information
Ingo Molnar committed Mar 26, 2009
4 parents e868460 + 7401922 + a2a5ac8 + 37bebc7 commit 7c526e1
Show file tree
Hide file tree
Showing 8 changed files with 357 additions and 234 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/spufs/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ static void __spu_add_to_rq(struct spu_context *ctx)
list_add_tail(&ctx->rq, &spu_prio->runq[ctx->prio]);
set_bit(ctx->prio, spu_prio->bitmap);
if (!spu_prio->nr_waiting++)
__mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK);
mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK);
}
}

Expand Down
6 changes: 3 additions & 3 deletions drivers/infiniband/hw/ipath/ipath_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2715,7 +2715,7 @@ static void ipath_hol_signal_up(struct ipath_devdata *dd)
* to prevent HoL blocking, then start the HoL timer that
* periodically continues, then stop procs, so they can detect
* link down if they want, and do something about it.
* Timer may already be running, so use __mod_timer, not add_timer.
* Timer may already be running, so use mod_timer, not add_timer.
*/
void ipath_hol_down(struct ipath_devdata *dd)
{
Expand All @@ -2724,7 +2724,7 @@ void ipath_hol_down(struct ipath_devdata *dd)
dd->ipath_hol_next = IPATH_HOL_DOWNCONT;
dd->ipath_hol_timer.expires = jiffies +
msecs_to_jiffies(ipath_hol_timeout_ms);
__mod_timer(&dd->ipath_hol_timer, dd->ipath_hol_timer.expires);
mod_timer(&dd->ipath_hol_timer, dd->ipath_hol_timer.expires);
}

/*
Expand Down Expand Up @@ -2763,7 +2763,7 @@ void ipath_hol_event(unsigned long opaque)
else {
dd->ipath_hol_timer.expires = jiffies +
msecs_to_jiffies(ipath_hol_timeout_ms);
__mod_timer(&dd->ipath_hol_timer,
mod_timer(&dd->ipath_hol_timer,
dd->ipath_hol_timer.expires);
}
}
Expand Down
22 changes: 2 additions & 20 deletions include/linux/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ static inline int timer_pending(const struct timer_list * timer)

extern void add_timer_on(struct timer_list *timer, int cpu);
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);
extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);

/*
* The jiffies value which is added to now, when there is no timer
Expand Down Expand Up @@ -146,25 +146,7 @@ static inline void timer_stats_timer_clear_start_info(struct timer_list *timer)
}
#endif

/**
* add_timer - start a timer
* @timer: the timer to be added
*
* The kernel will do a ->function(->data) callback from the
* timer interrupt at the ->expires point in the future. The
* current time is 'jiffies'.
*
* The timer's ->expires, ->function (and if the handler uses it, ->data)
* fields must be set prior calling this function.
*
* Timers with an ->expires field in the past will be executed in the next
* timer tick.
*/
static inline void add_timer(struct timer_list *timer)
{
BUG_ON(timer_pending(timer));
__mod_timer(timer, timer->expires);
}
extern void add_timer(struct timer_list *timer);

#ifdef CONFIG_SMP
extern int try_to_del_timer_sync(struct timer_list *timer);
Expand Down
2 changes: 1 addition & 1 deletion include/linux/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ struct timex {
* offset and maximum frequency tolerance.
*/
#define SHIFT_USEC 16 /* frequency offset scale (shift) */
#define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))
#define PPM_SCALE ((s64)NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))
#define PPM_SCALE_INV_SHIFT 19
#define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \
PPM_SCALE + 1)
Expand Down
3 changes: 2 additions & 1 deletion kernel/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,8 @@ static inline int fastpath_timer_check(struct task_struct *tsk)
if (task_cputime_expired(&group_sample, &sig->cputime_expires))
return 1;
}
return 0;

return sig->rlim[RLIMIT_CPU].rlim_cur != RLIM_INFINITY;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion kernel/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ size_t relay_switch_subbuf(struct rchan_buf *buf, size_t length)
* from the scheduler (trying to re-grab
* rq->lock), so defer it.
*/
__mod_timer(&buf->timer, jiffies + 1);
mod_timer(&buf->timer, jiffies + 1);
}

old = buf->data;
Expand Down
Loading

0 comments on commit 7c526e1

Please sign in to comment.