Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57938
b: refs/heads/master
c: 58229a1
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Linus Torvalds committed Jun 21, 2007
1 parent ed9113a commit 9590d15
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 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: b9bae3402572dc50a1e084c5b1ae5117918ef0f0
refs/heads/master: 58229a18994215bbfe0bcd1c99d2e039f30b076b
35 changes: 33 additions & 2 deletions trunk/kernel/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,40 @@ static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer)
* it should be restarted.
*/
if (timr->it.real.interval.tv64 != 0) {
ktime_t now = hrtimer_cb_get_time(timer);

/*
* FIXME: What we really want, is to stop this
* timer completely and restart it in case the
* SIG_IGN is removed. This is a non trivial
* change which involves sighand locking
* (sigh !), which we don't want to do late in
* the release cycle.
*
* For now we just let timers with an interval
* less than a jiffie expire every jiffie to
* avoid softirq starvation in case of SIG_IGN
* and a very small interval, which would put
* the timer right back on the softirq pending
* list. By moving now ahead of time we trick
* hrtimer_forward() to expire the timer
* later, while we still maintain the overrun
* accuracy, but have some inconsistency in
* the timer_gettime() case. This is at least
* better than a starved softirq. A more
* complex fix which solves also another related
* inconsistency is already in the pipeline.
*/
#ifdef CONFIG_HIGH_RES_TIMERS
{
ktime_t kj = ktime_set(0, NSEC_PER_SEC / HZ);

if (timr->it.real.interval.tv64 < kj.tv64)
now = ktime_add(now, kj);
}
#endif
timr->it_overrun +=
hrtimer_forward(timer,
hrtimer_cb_get_time(timer),
hrtimer_forward(timer, now,
timr->it.real.interval);
ret = HRTIMER_RESTART;
++timr->it_requeue_pending;
Expand Down

0 comments on commit 9590d15

Please sign in to comment.