diff --git a/xen/common/timer.c b/xen/common/timer.c index 1895a78..744bc66 100644 --- a/xen/common/timer.c +++ b/xen/common/timer.c @@ -25,7 +25,7 @@ #include #include -/* We program the time hardware this far behind the closest deadline. */ +/* We fire events up to this amount early. */ static unsigned int timer_slop __read_mostly = 50000; /* 50 us */ integer_param("timer_slop", timer_slop); @@ -463,14 +463,14 @@ static void timer_softirq_action(void) /* Execute ready heap timers. */ while ( (GET_HEAP_SIZE(heap) != 0) && - ((t = heap[1])->expires < now) ) + ((t = heap[1])->expires < (now + timer_slop) ) ) { remove_from_heap(heap, t); execute_timer(ts, t); } /* Execute ready list timers. */ - while ( ((t = ts->list) != NULL) && (t->expires < now) ) + while ( ((t = ts->list) != NULL) && (t->expires < (now + timer_slop) ) ) { ts->list = t->list_next; execute_timer(ts, t); @@ -493,7 +493,7 @@ static void timer_softirq_action(void) if ( (ts->list != NULL) && (ts->list->expires < deadline) ) deadline = ts->list->expires; this_cpu(timer_deadline) = - (deadline == STIME_MAX) ? 0 : deadline + timer_slop; + (deadline == STIME_MAX) ? 0 : deadline; if ( !reprogram_timer(this_cpu(timer_deadline)) ) raise_softirq(TIMER_SOFTIRQ);