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

Linus Torvalds
2005-07-15T00:43:39Z

On Fri, 15 Jul 2005, Jesper Juhl wrote:
>
> Even if we only have to do it once at boot? The thought was to detect
> what type of machine we are booting on, figure out what a good HZ
> would be for that type of box, then set that HZ value and treat it as
> a constant from that point forward.

No, it really should be a compile-time constant, or a lot of things get a
lot more expensive. There's a HZ embedded in a lot of places, and some of
them are divides, for example. Others do optimized special cases based on
static knowledge of what HZ is.

So this is why I so strongly argue that we should have a constant HZ, but
a dynamic _increment_ of "jiffies". Nobody (obviously) depends on jiffies
being constant, so it's ok to increment jiffies by pretty much any value.

Yeah, yeah, there might be some _very_ few code-paths (bogomips, I think)
that may look at when "jiffies" changes, and actually measure one tick
that way. They would need to be taught that they don't measure "one" tick
any more, they measure "jiffies_increment" ticks or something.

But I really wouldn't be surprised if the bogomips calibration loop was
really the only thing that needed some small tweaking for increments of
other than one.

(Oh, we'll find other things we want to fix up, and such a change would
result in other changes down the line, no question about that. But I
don't think it would be very much at all, and I don't think it would
turn out at all traumatic).

Linus