Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1628290 > unrolled thread
| Started by | Frederic Weisbecker <fweisbec@gmail.com> |
|---|---|
| First post | 2017-04-21 16:10 +0200 |
| Last post | 2017-04-23 13:50 +0200 |
| Articles | 2 — 2 participants |
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.
[PATCH 2/2] tick: Make sure tick timer is active when bypassing reprogramming Frederic Weisbecker <fweisbec@gmail.com> - 2017-04-21 16:10 +0200
[tip:timers/urgent] tick: Make sure tick timer is active when bypassing reprogramming tip-bot for Frederic Weisbecker <tipbot@zytor.com> - 2017-04-23 13:50 +0200
| From | Frederic Weisbecker <fweisbec@gmail.com> |
|---|---|
| Date | 2017-04-21 16:10 +0200 |
| Subject | [PATCH 2/2] tick: Make sure tick timer is active when bypassing reprogramming |
| Message-ID | <tyHq3-6LU-37@gated-at.bofh.it> |
So far we have run into too much troubles with the optimization path
that skips reprogramming the clock on IRQ exit when the expiration
deadline hasn't changed. If by accident the cached deadline happens to
be out of sync with the hardware deadline, the buggy result and its
cause are hard to investigate. So lets detect and warn about the issue
early.
Acked-by: Rik van Riel <riel@redhat.com>
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: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: 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 502b320..be7ca4d 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -783,8 +783,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 == ts->next_tick))
- goto out;
+ if (ts->tick_stopped && (expires == ts->next_tick)) {
+ /* Sanity check: make sure clockevent is actually programmed */
+ if (likely(dev->next_event <= ts->next_tick))
+ goto out;
+
+ WARN_ON_ONCE(1);
+ }
/*
* nohz_stop_sched_tick can be called several times before
--
2.7.4
[toc] | [next] | [standalone]
| From | tip-bot for Frederic Weisbecker <tipbot@zytor.com> |
|---|---|
| Date | 2017-04-23 13:50 +0200 |
| Subject | [tip:timers/urgent] tick: Make sure tick timer is active when bypassing reprogramming |
| Message-ID | <tzobE-7Vy-3@gated-at.bofh.it> |
| In reply to | #1628290 |
Commit-ID: 22aa2ad45fd8a6ef56eb60038fc0ac7059c0a986
Gitweb: http://git.kernel.org/tip/22aa2ad45fd8a6ef56eb60038fc0ac7059c0a986
Author: Frederic Weisbecker <fweisbec@gmail.com>
AuthorDate: Fri, 21 Apr 2017 16:00:55 +0200
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sun, 23 Apr 2017 13:33:18 +0200
tick: Make sure tick timer is active when bypassing reprogramming
So far we have run into too much troubles with the optimization path
that skips reprogramming the clock on IRQ exit when the expiration
deadline hasn't changed. If by accident the cached deadline happens to
be out of sync with the hardware deadline, the buggy result and its
cause are hard to investigate. So lets detect and warn about the issue
early.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: James Hartsock <hartsjc@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: stable@vger.kernel.org
Cc: Tim Wright <tim@binbash.co.uk>
Cc: Pavel Machek <pavel@ucw.cz>
Link: http://lkml.kernel.org/r/1492783255-5051-3-git-send-email-fweisbec@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
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 502b320..be7ca4d 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -783,8 +783,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 == ts->next_tick))
- goto out;
+ if (ts->tick_stopped && (expires == ts->next_tick)) {
+ /* Sanity check: make sure clockevent is actually programmed */
+ if (likely(dev->next_event <= ts->next_tick))
+ goto out;
+
+ WARN_ON_ONCE(1);
+ }
/*
* nohz_stop_sched_tick can be called several times before
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web