Re: Periodic clock tick considered harmful (was: Re: HZ, preferably as small

Linus Torvalds (torvalds@transmeta.com)
Mon, 15 Jul 2002 05:21:19 +0000 (UTC)


In article <3D2DB5F3.3C0EF4A2@kegel.com>, <dank@kegel.com> wrote:
>
>How about this: let's apply the high-resolution timer patch,
>which adds explicit timer events inbetween the normal 100 Hz
>events when needed to satisfy precise sleep requests.

The thing is, I think that's the wrong way around.

What we should have is a notion of a reasonably high frequency timer,
and then _slow_it_down_ to something else if not needed.

Speeding the timer up is bad, because:
- you do need to limit the speedup to _something_ anyway (and it might
as well be HZ)
- you get "partial jiffies", which means that only stuff that knows
about the finer granularity gets it.

In contrast, if you slow things down in integer increments of "n", the
only thing you need to do is to add in "n" instead of "1" in the timer
tick handler. Nobody else needs to really care - there is no such thing
as a "fractional jiffy".

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/