Re: [PATCH] Time precision, adjtime(x) vs. gettimeofday

From: john stultz
Date: Wed Oct 08 2003 - 14:17:30 EST


On Wed, 2003-10-08 at 11:25, Stephen Hemminger wrote:
> On Wed, 08 Oct 2003 15:32:31 +0200
> Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > That means that if, for example, adjtimex was called with a factor
> > that is trying to slow you down a bit, and you call gettimeofday
> > right before the end of a jiffy period, you may calculate an offset
> > based on the HW timer that is actually higher than what will be
> > really added to xtime on the next interrupt.
[snip]
> The following will prevent adjtime from causing time regression.
> It delays starting the adjtime mechanism for one tick, and
> keeps gettimeofday inside the window.

Hmm. Looks good to me. If we're losing ticks, it would make time
stair-step somewhat, but it doesn't seem to affect the actual time
accumulation.

thanks
-john



-
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/