tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Bug fix for PR 26470 for review

On 24 May 2008, at 14:03 , Joerg Sonnenberger wrote:

On Sat, May 24, 2008 at 01:44:59PM -0700, Dennis Ferguson wrote:
That might fix the symptom but I think a better fix for the problem
would be to keep interval timers in terms of uptime (i.e. getmicrouptime()) instead of time. Then they'd be unaffected by calls to settimeofday(), and you'd fix not only the kernel looping but also the imprecise interval
you'll still have when settimeofday() is used.

That is a separate issue. Note that one reason why even uptime can skip
is suspension of the system. I don't mean what you mean by imprecise

I guess I see what you mean, though keeping the timers in uptime does fix the particular issue the PR is complaining about and also ensures that if
you ask for an interrupt every 10 seconds you get an interrupt every 10
seconds (apart from suspensions) no matter what someone else does with

I can see that the code in there should probably be made to behave no
matter what happens to whichever time source is being used to measure
intervals, however, so what you've done is probably necessary for robustness
regardless.  I'd note, however, that in all normal cases the code which
is there now will only be doing a single add, and that your patch changes
this into a couple of divides in all cases.  It might be better to save
the divides just for the case where the single add fails to advance the time
past `now' as this should seldom happen.

Dennis Ferguson
be doing a single add

Home | Main Index | Thread Index | Old Index