This is great Lennert! Thanks for looking into this!
At first glance it seems you skip calling timer_tick() every once in
awhile to fix the accumulated error. Can you comment on how (if at
all) this might effect worst case process and timer event scheduling
and small interval event timing now that theres a potential ~2x longer
clock period every so often. Specifically, if I'm measuring time
between two points A and B around 1.45 seconds or so(*) and happen to
experience the skipped clock tick in-between, would I randomly be
missing approx 10 ms of real time in my difference calculation?
(*) For instance, an embedded design that uses the "poor mans ADC"
technique of timing how long a bleeding capacitor takes to turn from a
1 to a 0 to determine analog voltage.
//Jesse Off
> Sorry, didn't have much time today. The patch below (against
> 2.6.17-rc2) should in theory (untested) make linux timekeeping as
> accurate as possible, limited only by accuracy of the hardware.
>
> Attached to this email is a small simulation program (blah.c) that
> kind of sort of demonstrates that the algorithm is correct. But of
> course, someone will still have to verify it in practise. :-)
>
>
> cheers,
> Lennert
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|