diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-01-15 19:19:27 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-02-25 15:39:01 -0500 |
commit | aea369b959bef10d235cd0714789cd8b0fe170b8 (patch) | |
tree | 61d445c4986184e5f041c2c3f88896b02aa8f54b /kernel/timer.c | |
parent | 18d8cb64c9c074cbe2bd677ab10fff8283abdb62 (diff) |
timers: Make internal_add_timer() update ->next_timer if ->active_timers == 0
The internal_add_timer() function updates base->next_timer only if
timer->expires < base->next_timer. This is correct, but it also makes
sense to do the same if we add the first non-deferrable timer.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Mike Galbraith <bitbucket@online.de>
Diffstat (limited to 'kernel/timer.c')
-rw-r--r-- | kernel/timer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index 0c638cf3d9d2..c0d8898fed98 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -404,9 +404,9 @@ static void internal_add_timer(struct tvec_base *base, struct timer_list *timer) | |||
404 | * Update base->active_timers and base->next_timer | 404 | * Update base->active_timers and base->next_timer |
405 | */ | 405 | */ |
406 | if (!tbase_get_deferrable(timer->base)) { | 406 | if (!tbase_get_deferrable(timer->base)) { |
407 | if (time_before(timer->expires, base->next_timer)) | 407 | if (!base->active_timers++ || |
408 | time_before(timer->expires, base->next_timer)) | ||
408 | base->next_timer = timer->expires; | 409 | base->next_timer = timer->expires; |
409 | base->active_timers++; | ||
410 | } | 410 | } |
411 | base->all_timers++; | 411 | base->all_timers++; |
412 | } | 412 | } |