Re: [PATCH] i386: Selectable Frequency of the Timer Interrupt

Linus Torvalds
2005-07-14T20:11:54Z

On Thu, 14 Jul 2005, Russell King wrote:
>
> Umm. Except, according to your description of what it's supposed to
> do, the above code can have an accumulating error.

No. It can have a local drift, but the point is, the error never gets
worse - it _stays_ local.

There's no point in polling twice in immediate succession just because a
sleep overslept. That's like a security guard testing each door twice for
being locked, just because he overslept one round. Pointless.

But what matters is that you don't let your local errors accumulate into
the big picture.

Now, if somebody wants to make nicer helper functions so that you can say

timeout = ms_from_now(500);

or something instead of saying "timeout = jiffies + HZ/2", then hey, go
wild. At that point it's just syntactic sugar, and maybe it's worth it.

Linus