Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1645618 > unrolled thread

[PATCH 1/2] nohz: Add hrtimer sanity check

Started byFrederic Weisbecker <fweisbec@gmail.com>
First post2017-05-19 16:00 +0200
Last post2017-05-19 16:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] nohz: Add hrtimer sanity check Frederic Weisbecker <fweisbec@gmail.com> - 2017-05-19 16:00 +0200

#1645618 — [PATCH 1/2] nohz: Add hrtimer sanity check

FromFrederic Weisbecker <fweisbec@gmail.com>
Date2017-05-19 16:00 +0200
Subject[PATCH 1/2] nohz: Add hrtimer sanity check
Message-ID<tIQBH-2TK-3@gated-at.bofh.it>
Make sure that the clockevent device is never programmed to a deadline
later than the tick.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Tim Wright <tim@binbash.co.uk>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: James Hartsock <hartsjc@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web