Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.

From: Ingo Molnar
Date: Thu Oct 20 2005 - 03:01:52 EST



* Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> > i could imagine the following hardware effects to cause time warps:
> >
> > - the TSC is in fact the 'read counter' method of the local APIC timer
> > hardware. So there can be interactions in theory: programming the APIC
> > timer could impact the TSC and vice versa. There have been CPU
> > erratums in this area in the past.
>
> Could this cause a 2 second drop backwards?

i dont think so.

> > - the TSC itself could have short, temporary warps. I had a box that
> > showed such effects.
>
> Can this be a 2 second warp?

the ones i saw were in the 1000-cycles range.

> My older code first used jiffies as a timer, then I switched to TSC
> and then to APIC timer, and then finally ktimer. ktimer was the first
> to show a backwards get_time.

another thing: the monotonicity check is only in get_ktime_mono(), while
there are other places where a monotonic clock is used, which this check
might miss.

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/