[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1495201910-12466-2-git-send-email-fweisbec@gmail.com>
Date: Fri, 19 May 2017 15:51:49 +0200
From: Frederic Weisbecker <fweisbec@...il.com>
To: Ingo Molnar <mingo@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Rik van Riel <riel@...hat.com>,
James Hartsock <hartsjc@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>, stable@...r.kernel.org,
Tim Wright <tim@...bash.co.uk>, Pavel Machek <pavel@....cz>
Subject: [PATCH 1/2] nohz: Add hrtimer sanity check
Make sure that the clockevent device is never programmed to a deadline
later than the tick.
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Tim Wright <tim@...bash.co.uk>
Cc: Pavel Machek <pavel@....cz>
Cc: James Hartsock <hartsjc@...hat.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Rik van Riel <riel@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/time/tick-sched.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 64c97fc..d212bb6 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -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
--
2.7.4
Powered by blists - more mailing lists