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 25 May 2008, at 07:45 , Joerg Sonnenberger wrote:
On Sat, May 24, 2008 at 04:11:46PM -0700, Dennis Ferguson wrote:
I think that's what I'm pointing out.  You are adding the div/mod to
fix a case that seldom happens, but the div/mod always happens.

You misunderstood. The whole branch is very unlikely to happen as you
don't call settimeofday *at all* during normal operation. E.g. you run
ntp on your machines to keep the time in sync and don't just skip time.

One of us misunderstands, I guess.  realtimerexpire() is called every
time an interval timer expires.  Your change unconditionally makes this
code more expensive to execute.  I'm just encouraging you to save this
expense only for the case where the current code is broken.  Putting the
new code inside an if(){} which is seldom true is the entire point.

Your change also changes the behaviour of the code when the time is
stepped backwards.  What I've been pointing out is that this problem
is fixed at no cost whatsoever by changing the time base used for
interval timers to uptime (i.e. change the calls to getmicrotime()
to getmicrouptime()).  This change has the added benefit that it
becomes entirely irrelevant how often I call settimeofday(), or for
what purpose, since the code won't care, but that is beside the
point.  The point is that it eliminates a change which costs something
by making a change which costs nothing.

So I guess my issue is that you are changing this code in a way which
makes it more expensive when alternative fixes for all the same problems
exist which are no more complex and which cost nothing at all.  If this
doesn't matter to you, however, then never mind. Your patch is functionally
correct if you don't care about interval timers being called (rarely) at
intervals shorter than the user specified.

Dennis Ferguson

Home | Main Index | Thread Index | Old Index