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

christoph
2005-05-16T20:43:50Z

Make the timer frequency selectable. The timer interrupt may cause bus
and memory contention in large NUMA systems since the interrupt occurs
on each processor HZ times per second.

Signed-off-by: Christoph Lameter <christoph@scale86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>

Index: linux-2.6.11/arch/i386/Kconfig
===================================================================
--- linux-2.6.11.orig/arch/i386/Kconfig 2005-05-16 12:07:31.000000000 -0700
+++ linux-2.6.11/arch/i386/Kconfig 2005-05-16 12:39:48.000000000 -0700
@@ -939,6 +939,20 @@ config SECCOMP

If unsure, say Y. Only embedded should say N here.

+config HZ
+ int "Frequency of the Timer Interrupt (1000 or 100)"
+ range 100 1000
+ default 1000
+ help
+ Allows the configuration of the timer frequency. It is customary
+ to have the timer interrupt run at 1000 HZ but 100 HZ may be more
+ beneficial for servers and NUMA systems that do not need to have
+ a fast response for user interaction and that may experience bus
+ contention and cacheline bounces as a result of timer interrupts.
+ Note that the timer interrupt occurs on each processor in an SMP
+ environment leading to NR_CPUS * HZ number of timer interrupts
+ per second.
+
endmenu

Index: linux-2.6.11/include/asm-i386/param.h
===================================================================
--- linux-2.6.11.orig/include/asm-i386/param.h 2005-05-16 12:07:25.000000000 -0700
+++ linux-2.6.11/include/asm-i386/param.h 2005-05-16 12:09:04.000000000 -0700
@@ -2,7 +2,7 @@
#define _ASMi386_PARAM_H

#ifdef __KERNEL__
-# define HZ 1000 /* Internal kernel timer frequency */
+# define HZ CONFIG_HZ /* Internal kernel timer frequency */
# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
#endif