public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] HZ as a config option
@ 2002-10-04 22:53 Dave Hansen
  2002-10-05  0:53 ` Alan Cox
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Hansen @ 2002-10-04 22:53 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]

On large systems (like NUMA-Q, Intel Profusion, etc...), latency and 
user responsiveness become much less important.  The extra scheduling 
overhead caused by higher HZ is bad.

This is x86-only right now.  Is there any wider desire to tune this at 
config time?  Do any architecutures have strict rules as to what this 
can be set to?
-- 
Dave Hansen
haveblue@us.ibm.com

[-- Attachment #2: config_hz-2.5.40-1.patch --]
[-- Type: text/plain, Size: 2385 bytes --]

diff -ur linux-2.5.40/arch/i386/Config.help linux-2.5.40-hz_config/arch/i386/Config.help
--- linux-2.5.40/arch/i386/Config.help	2002-10-01 00:06:17.000000000 -0700
+++ linux-2.5.40-hz_config/arch/i386/Config.help	2002-10-04 15:25:52.000000000 -0700
@@ -850,6 +850,17 @@
 
   If in doubt, say N.
 
+CONFIG_HZ
+  This is unrelated to your processor's speed.  This variable alters
+  how often the system is asked to generate timer interrupts.  A larger
+  value can lead to a more responsive system, but also causes extra 
+  overhead from the increased number of context switches.
+
+  In older kernels, this was set to 100.  In 2.5, it was set to 1000.
+  HZ must be greater than 11 and less than 1536.
+
+  If in doubt, leave it at the default of 1000. 
+
 CONFIG_CPU_FREQ_24_API
   This enables the /proc/sys/cpu/ sysctl interface for controlling
   CPUFreq, as known from the 2.4.-kernel patches for CPUFreq. Note
diff -ur linux-2.5.40/arch/i386/config.in linux-2.5.40-hz_config/arch/i386/config.in
--- linux-2.5.40/arch/i386/config.in	2002-10-04 14:25:29.000000000 -0700
+++ linux-2.5.40-hz_config/arch/i386/config.in	2002-10-04 15:21:21.000000000 -0700
@@ -208,6 +208,10 @@
    fi
 fi
 
+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+	int 'Kernel Timer Frequency (HZ)' CONFIG_HZ 1000
+fi
+		  
 tristate 'Toshiba Laptop support' CONFIG_TOSHIBA
 tristate 'Dell laptop support' CONFIG_I8K
 
diff -ur linux-2.5.40/include/asm-i386/param.h linux-2.5.40-hz_config/include/asm-i386/param.h
--- linux-2.5.40/include/asm-i386/param.h	2002-10-01 00:06:20.000000000 -0700
+++ linux-2.5.40-hz_config/include/asm-i386/param.h	2002-10-04 14:54: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
diff -ur linux-2.5.40/include/linux/timex.h linux-2.5.40-hz_config/include/linux/timex.h
--- linux-2.5.40/include/linux/timex.h	2002-10-01 00:06:15.000000000 -0700
+++ linux-2.5.40-hz_config/include/linux/timex.h	2002-10-04 15:24:04.000000000 -0700
@@ -76,7 +76,7 @@
 #elif HZ >= 768 && HZ < 1536
 # define SHIFT_HZ	10
 #else
-# error You lose.
+# error Please use a HZ value which is between 12 and 1536 
 #endif
 
 /*

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-10-07 20:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-04 22:53 [RFC][PATCH] HZ as a config option Dave Hansen
2002-10-05  0:53 ` Alan Cox
2002-10-07 16:58   ` Dave Hansen
2002-10-07 17:19     ` Alan Cox
2002-10-07 17:27     ` george anzinger
2002-10-07 19:27       ` Vojtech Pavlik
2002-10-07 20:25         ` george anzinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox