Determining and changing the rate of timer interrupts a guest operating system requests (1005802)
Default mainline values
- Linux 2.4: HZ = 100Hz.
- Linux 2.6.0 - 2.6.13: HZ = 1000Hz.
- Linux 2.6.14 onward: HZ = 250Hz.
Tickless Linux Kernels
Starting with Linux 2.6.18, Linux kernels began transitioning away from tick counting. Some new kernels use aperiodic interrupts rather than programming a periodic timer interrupt. These kernels are called tickless kernels. For tickless Linux kernels, HZ still influences the rate at which aperiodic timer interrupts are requested, but since these interrupts are not counted for timekeeping, the value of HZ does not impact timekeeping.Generally tickless Linux kernels do not use the PIT at all, and instead just use aperiodic Local APIC timer interrupts.
Affected Vendor kernels
- Redhat Enterprise Linux 4: HZ = 1000Hz
- Redhat Enterprise Linux 5: HZ = 1000Hz
- SUSE Linux Enterprise Server 9: HZ = 1000Hz
- SUSE Linux Enterprise Server 10: HZ = 250Hz
- Ubuntu 6.10: HZ = 250Hz
- Ubuntu 7.04 and 7.10 Desktop: HZ = 250Hz
"divider" kernel command line option
Recompiling with a different HZ value
- Compare /proc/interrupts at the beginning and end of a 10 second interval.
From a shell prompt run cat /proc/interrupts ; sleep 10; cat /proc/interrupts .
There are several columns. The first is the IRQ number. The PIT is the device that generates the interrupts that Linux counts for time keeping. This is IRQ 0. Also of interest is "LOC" which is the Local APIC timer. For each vCPU there is a column listing the number of interrupts that device has raised on that vCPU. The final two columns give the interrupt type and a name for the devices on that IRQ.
- before = Sum of all PIT interrupts received on all vCPUs before sleep.
- after = Sum of all PIT interrupts received on all vCPUs after sleep.
- timer rate = (after - before) / 10 seconds