Re: [4/5] 2.6.21-rc4: known regressions (v2)

Thomas Gleixner
2007-03-23T23:28:24Z

On Fri, 2007-03-23 at 23:43 +0100, Thomas Gleixner wrote:
> On Fri, 2007-03-23 at 18:23 -0400, Chuck Ebbert wrote:
> > Thomas Gleixner wrote:
> > > On Fri, 2007-03-23 at 19:50 +0100, Adrian Bunk wrote:
> > >> Subject : gettimeofday increments too slowly
> > >> References : http://bugzilla.kernel.org/show_bug.cgi?id=8027
> > >> Submitter : David L <idht4n@hotmail.com>
> > >> Caused-By : Thomas Gleixner <tglx@linutronix.de>
> > >> commit 92c7e00254b2d0efc1e36ac3e45474ce1871b6b2
> > >> Handled-By : Thomas Gleixner <tglx@linutronix.de>
> > >> Status : problem is being debugged
> > >
> > > Patch available: http://lkml.org/lkml/2007/3/22/301
> > >
> > > commit 6b3964cde70cfe6db79d35b42137431ef7d2f7e4
> > >
> >
> > For the other issue raised there, clock running too slow, I now
> > realize there is a similar report:
> >
> > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=231626
>
> That's a different one, AFAICT. Davids problem is probably caused by me
> breaking the TSC watchdog.
>
> /me orders paperbags prophylactically and goes back to look at the code

David,

can you please test the patch below ?

tglx

--------------------->
Subject: [PATCH] clocksource: Fix thinko in watchdog selection

The watchdog implementation excludes low res / non continuous
clocksources from being selected as a watchdog reference
unintentionally.

Allow using jiffies/PIT as a watchdog reference as long as no better
clocksource is available. This is necessary to detect TSC breakage on
systems, which have no pmtimer/hpet.

The main goal of the initial patch (preventing to switch to highres/nohz
when no reliable fallback clocksource is available) is still guaranteed
by the checks in clocksource_watchdog().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 5b0e46b..fe5c7db 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -151,7 +151,8 @@ static void clocksource_check_watchdog(struct clocksource *cs)
watchdog_timer.expires = jiffies + WATCHDOG_INTERVAL;
add_timer(&watchdog_timer);
}
- } else if (cs->flags & CLOCK_SOURCE_IS_CONTINUOUS) {
+ } else {
+ if (cs->flags & CLOCK_SOURCE_IS_CONTINUOUS)
cs->flags |= CLOCK_SOURCE_VALID_FOR_HRES;

if (!watchdog || cs->rating > watchdog->rating) {