Re: clocksource

john stultz
2006-06-08T08:05:11Z

On Wed, 2006-06-07 at 02:41 +0200, Roman Zippel wrote:
> On Tue, 6 Jun 2006, john stultz wrote:
> > > With large clock offsets the lookahead doesn't work correctly, basically
> > > because it's already to late and it can cause overadjustment. Because of
> > > this I do an extra lookahead in clocksource_bigadjust().
> >
> > Do you have a hard example for this with numbers? I don't mean to be a
> > pain, but I don't see this right off.
> >
> > With the current code in -mm I can run a test app that disables
> > interrupts for 2 seconds at a time over and over and I'm still keeping
> > synched w/ an NTP server within 30 microseconds.
>
> You need a clock source which doesn't generate it's own interrupts, so
> interrupts and clock updates can run asynchron. The key part above is
> "large clock offsets". In my test program disable the extra lookahead and
> run it with large offsets.

I'm not sure I'm following you here. Almost all clocksources on i386
(specifically, in the case above, I was using the apci_pm) don't
generate interrupts and run asynchronous from the timer interrupt
source.

I did re-review your documentation, and while it does go over the mult
adjustment code in nice understandable terms, the "why" of this
additional look-ahead isn't quite obvious.

> This code gets only limited testing in -mm, it needs to run for weeks
> or months, which I don't expect from the average -mm kernel. This makes
> userspace simulations so damn important and if you don't do this, you're
> playing a very risky game with a kernel which is supposed to be stable.

Agreed, simulation is nice. Thus, I've revived the old simulator which
builds using the existing code in -mm. Its a bit fast/dirty and isn't
exactly like your sim, but maybe you can take a look at it and send
patches to improve it?

You can find it at:
http://sr71.net/~jstultz/tod/simulator_C2.tar.bz2

I'm currently using it in testing my attempts to get your bigadjust code
working, so hopefully it will help there.

> > > For this I also I posted a userspace test program, so that I know how it
> > > behaves, do you have something similiar for yours?
> >
> > At your prodding awhile back I wrote a userspace simulator, but you
> > never commented on it.
>
> It was very hard to get running at all and in the meantime you had updated
> patches and the whole thing didn't work anymore. Sorry, that I didn't
> comment on it more.

Please let me know if you still have difficulty getting this new one
running.

thanks
-john