]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
nohz: Add hrtimer sanity check
authorFrederic Weisbecker <fweisbec@gmail.com>
Thu, 11 May 2017 14:36:19 +0000 (16:36 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 17 May 2017 06:19:26 +0000 (08:19 +0200)
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/time/tick-sched.c

index 64c97fc130c4db2f1241185d9075af7a0f5175f5..d212bb62bc08ca7a540fdd44a6aa5e7c01224fad 100644 (file)
@@ -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