From: Daniel Walker <dwalker@mvista.com>
To: mingo@elte.hu
Cc: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH -rt] disconnect warp check from hrtimers
Date: Wed, 27 Dec 2006 09:28:29 -0800 [thread overview]
Message-ID: <20061227172828.998757000@mvista.com> (raw)
These calls were getting inconsistent wrt. the xtime_lock. The xtime_lock should
be held when doing the warp check update, and interrupts should be off.
In some places the warp update was getting called twice, once under the xtime_lock
then again right outside the xtime_lock.
Signed-Off-By: Daniel Walker <dwalker@mvista.com>
---
include/linux/hrtimer.h | 2 +-
kernel/hrtimer.c | 2 --
kernel/time/ntp.c | 2 ++
kernel/timer.c | 1 +
4 files changed, 4 insertions(+), 3 deletions(-)
Index: linux-2.6.19/include/linux/hrtimer.h
===================================================================
--- linux-2.6.19.orig/include/linux/hrtimer.h
+++ linux-2.6.19/include/linux/hrtimer.h
@@ -262,7 +262,7 @@ static inline ktime_t hrtimer_cb_get_tim
* is expired in the next softirq when the clock was advanced.
* (we still call the warp-check debugging code)
*/
-static inline void clock_was_set(void) { warp_check_clock_was_changed(); }
+static inline void clock_was_set(void) { }
static inline void hrtimer_clock_notify(void) { }
/*
Index: linux-2.6.19/kernel/hrtimer.c
===================================================================
--- linux-2.6.19.orig/kernel/hrtimer.c
+++ linux-2.6.19/kernel/hrtimer.c
@@ -452,8 +452,6 @@ static void retrigger_next_event(void *a
*/
void clock_was_set(void)
{
- warp_check_clock_was_changed();
-
/* Retrigger the CPU local events everywhere */
on_each_cpu(retrigger_next_event, NULL, 0, 1);
}
Index: linux-2.6.19/kernel/time/ntp.c
===================================================================
--- linux-2.6.19.orig/kernel/time/ntp.c
+++ linux-2.6.19/kernel/time/ntp.c
@@ -116,6 +116,7 @@ void second_overflow(void)
*/
time_interpolator_update(-NSEC_PER_SEC);
time_state = TIME_OOP;
+ warp_check_clock_was_changed();
clock_was_set();
printk(KERN_NOTICE "Clock: inserting leap second "
"23:59:60 UTC\n");
@@ -131,6 +132,7 @@ void second_overflow(void)
*/
time_interpolator_update(NSEC_PER_SEC);
time_state = TIME_WAIT;
+ warp_check_clock_was_changed();
clock_was_set();
printk(KERN_NOTICE "Clock: deleting leap second "
"23:59:59 UTC\n");
Index: linux-2.6.19/kernel/timer.c
===================================================================
--- linux-2.6.19.orig/kernel/timer.c
+++ linux-2.6.19/kernel/timer.c
@@ -1162,6 +1162,7 @@ static int timekeeping_resume(struct sys
clock->cycle_last = clocksource_read(clock);
clock->error = 0;
timekeeping_suspended = 0;
+ warp_check_clock_was_changed();
write_sequnlock_irqrestore(&xtime_lock, flags);
hrtimer_notify_resume();
--
next reply other threads:[~2006-12-27 17:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-27 17:28 Daniel Walker [this message]
2006-12-27 17:39 ` Ingo Molnar
2006-12-27 17:53 ` Daniel Walker
2006-12-27 18:04 ` Daniel Walker
2006-12-27 18:36 ` Daniel Walker
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=20061227172828.998757000@mvista.com \
--to=dwalker@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®