From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Rik van Riel <riel@redhat.com>,
James Hartsock <hartsjc@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
stable@vger.kernel.org, Tim Wright <tim@binbash.co.uk>,
Pavel Machek <pavel@ucw.cz>
Subject: [PATCH 1/2] nohz: Add hrtimer sanity check
Date: Fri, 19 May 2017 15:51:49 +0200 [thread overview]
Message-ID: <1495201910-12466-2-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1495201910-12466-1-git-send-email-fweisbec@gmail.com>
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
next prev parent reply other threads:[~2017-05-19 13:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-19 13:51 [PATCH 0/2] nohz: Deal with clock reprogram skipping issues v3 Frederic Weisbecker
2017-05-19 13:51 ` Frederic Weisbecker [this message]
2017-05-19 13:51 ` [PATCH 2/2] nohz: Fix collision between tick and other hrtimers, again Frederic Weisbecker
2017-05-23 7:25 ` [PATCH 0/2] nohz: Deal with clock reprogram skipping issues v3 Ingo Molnar
2017-05-23 13:10 ` Frederic Weisbecker
2017-05-24 7:16 ` Ingo Molnar
2017-05-24 13:28 ` Frederic Weisbecker
2017-05-26 2:10 ` Frederic Weisbecker
2017-05-26 6:13 ` Ingo Molnar
2017-05-29 13:55 ` Frederic Weisbecker
2017-05-30 5:47 ` Ingo Molnar
2017-05-30 12:51 ` Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1495201910-12466-2-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=hartsjc@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=pavel@ucw.cz \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tim@binbash.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox