public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: linux-kernel@vger.kernel.org
Subject: [RFC][PATCH] HZ as a config option
Date: Fri, 04 Oct 2002 15:53:30 -0700	[thread overview]
Message-ID: <3D9E1BEA.7060804@us.ibm.com> (raw)

[-- 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
 
 /*

             reply	other threads:[~2002-10-04 22:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-04 22:53 Dave Hansen [this message]
2002-10-05  0:53 ` [RFC][PATCH] HZ as a config option 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D9E1BEA.7060804@us.ibm.com \
    --to=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox