* [PATCH -rt] disconnect warp check from hrtimers
@ 2006-12-27 17:28 Daniel Walker
2006-12-27 17:39 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2006-12-27 17:28 UTC (permalink / raw)
To: mingo; +Cc: linux-kernel, Thomas Gleixner
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();
--
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH -rt] disconnect warp check from hrtimers
2006-12-27 17:28 [PATCH -rt] disconnect warp check from hrtimers Daniel Walker
@ 2006-12-27 17:39 ` Ingo Molnar
2006-12-27 17:53 ` Daniel Walker
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2006-12-27 17:39 UTC (permalink / raw)
To: Daniel Walker; +Cc: linux-kernel, Thomas Gleixner
* Daniel Walker <dwalker@mvista.com> wrote:
> 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.
thanks, applied. Does this solve some warnings that you saw trigger?
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -rt] disconnect warp check from hrtimers
2006-12-27 17:39 ` Ingo Molnar
@ 2006-12-27 17:53 ` Daniel Walker
2006-12-27 18:04 ` Daniel Walker
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2006-12-27 17:53 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel, Thomas Gleixner
On Wed, 2006-12-27 at 18:39 +0100, Ingo Molnar wrote:
> * Daniel Walker <dwalker@mvista.com> wrote:
>
> > 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.
>
> thanks, applied. Does this solve some warnings that you saw trigger?
I saw some unexplained time warping while using the source at this url,
http://www.atnf.csiro.au/people/rgooch/benchmarks/linux-scheduler.html
it was on an older 2.6.18 based -rt .. The system would print the time
warp warning, then hang .. I applied something similar to the patch I
just sent, and the time warp warning was gone but the system still hung.
New -rt version don't hang, and I don't see the warning .. However, I
suspect the time warp warning was a side effect of the hang..
The system hang was resolved by changing the irq threads to all prio
50 ..
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -rt] disconnect warp check from hrtimers
2006-12-27 17:53 ` Daniel Walker
@ 2006-12-27 18:04 ` Daniel Walker
2006-12-27 18:36 ` Daniel Walker
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2006-12-27 18:04 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel, Thomas Gleixner
On Wed, 2006-12-27 at 09:53 -0800, Daniel Walker wrote:
> The system hang was resolved by changing the irq threads to all prio
> 50 ..
Guess I was wrong about this.. The hang was resolved, but I's not sure
how yet ..
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -rt] disconnect warp check from hrtimers
2006-12-27 18:04 ` Daniel Walker
@ 2006-12-27 18:36 ` Daniel Walker
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Walker @ 2006-12-27 18:36 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel, Thomas Gleixner
On Wed, 2006-12-27 at 10:04 -0800, Daniel Walker wrote:
> On Wed, 2006-12-27 at 09:53 -0800, Daniel Walker wrote:
>
> > The system hang was resolved by changing the irq threads to all prio
> > 50 ..
>
> Guess I was wrong about this.. The hang was resolved, but I's not sure
> how yet ..
Looks like it was the irq thread priority _and_ the softirq prio needed
to be raised. softirq was at SCHED_FIFO 1 which caused the hang (or
that's how it looks).
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-12-27 18:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-27 17:28 [PATCH -rt] disconnect warp check from hrtimers Daniel Walker
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
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®