Skip to content

Commit

Permalink
nohz: Add hrtimer sanity check
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed May 17, 2017
1 parent b23afd3 commit ce6cf9a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,13 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
tick = expires;

/* Skip reprogram of event if its not changed */
if (ts->tick_stopped && (expires == dev->next_event))
goto out;
if (ts->tick_stopped) {
if (hrtimer_active(&ts->sched_timer))
WARN_ON_ONCE(hrtimer_get_expires(&ts->sched_timer) < dev->next_event);

if (expires == dev->next_event)
goto out;
}

/*
* nohz_stop_sched_tick can be called several times before
Expand Down

0 comments on commit ce6cf9a

Please sign in to comment.