RE: Why HZ on i386 is 100 ?

Richard B. Johnson
2002-04-16T13:04:36Z

On Tue, 16 Apr 2002, BALBIR SINGH wrote:

> I remember seeing somewhere unix system VII used to have HZ set to 60
> for the machines built in the 70's. I wonder if todays pentium iiis and ivs
> should still use HZ of 100, though their internal clock is in GHz.
>

A different clock goes to the timer chip. It is always:

CLOCK_TICK_RATE 1193180 Hz
unless an Elan SC-520 at which time the frequency is:
CLOCK_TICK_RATE 1189200 Hz

(from ../include/asm/timex.h)

> I think somethings in the kernel may be tuned for the value of HZ, these
> things would be arch specific.
>
> Increasing the HZ on your system should change the scheduling behaviour,
> it could lead to more aggresive scheduling and could affect the
> behaviour of the VM subsystem if scheduling happens more frequently. I am
> just guessing, I do not know.
>

It doesn't/can't change scheduling behavior. It changes only the rate
at which a CPU bound task will get the CPU taken away. It also changes
the rate it which it gets it back, in a 1:1 ratio, with a net effect
of nothing-gained/nothing-lost except for preemption overhead.

> Changing though trivial would require a good look at all the code that
> uses HZ.
>

The reference to HZ seems to be correct in all the headers so changing
it is trivial.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).

Windows-2000/Professional isn't.