WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Make HZ a boot-time configurable

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Make HZ a boot-time configurable
From: Kip Macy <kmacy@xxxxxxxxxx>
Date: Sun, 8 May 2005 13:23:29 -0700 (PDT)
Delivery-date: Sun, 08 May 2005 20:23:04 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
I understand the trade-offs that xen is currently optimized for. However, I
don't think that HZ=100 is right for all places and all times. I also think that
users would appreciate it if they didn't have to go edit config.h and re-compile
if they wanted to change HZ. For those using xen as a platform for development
it probably makes sense if HZ is the same as the kernel they intend to ship. For
example, very early on in testing with HZ=1000 I hit an interrupt race condition
in XenFreeBSD that I have never seen before.




# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/05/08 13:12:30-07:00 kmacy@xxxxxxxxxxxxxxxxxxxx 
#   Make HZ a boot-time configurable
#   Signed-off-by: Kip Macy <kmacy@xxxxxxxxxx>
# 
# BitKeeper/etc/logging_ok
#   2005/05/08 13:12:30-07:00 kmacy@xxxxxxxxxxxxxxxxxxxx +1 -0
#   Logging to logging@xxxxxxxxxxxxxxx accepted
# 
# xen/include/asm-x86/config.h
#   2005/05/08 13:12:15-07:00 kmacy@xxxxxxxxxxxxxxxxxxxx +3 -1
#   make HZ a tunable
# 
# xen/arch/x86/nmi.c
#   2005/05/08 13:12:15-07:00 kmacy@xxxxxxxxxxxxxxxxxxxx +2 -1
#   make HZ tunable
# 
# xen/arch/x86/apic.c
#   2005/05/08 13:12:15-07:00 kmacy@xxxxxxxxxxxxxxxxxxxx +3 -0
#   make HZ tunable
# 
diff -Nru a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c       2005-05-07 13:19:11 -07:00
+++ b/xen/arch/x86/apic.c       2005-05-07 13:19:11 -07:00
@@ -42,6 +42,9 @@
 
 static int enabled_via_apicbase;
 
+unsigned int HZ = 100;
+integer_param("hz", HZ);
+
 int get_maxlvt(void)
 {
     unsigned int v, ver, maxlvt;
diff -Nru a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
--- a/xen/arch/x86/nmi.c        2005-05-07 13:19:11 -07:00
+++ b/xen/arch/x86/nmi.c        2005-05-07 13:19:11 -07:00
@@ -29,7 +29,7 @@
 
 unsigned int nmi_watchdog = NMI_NONE;
 unsigned int watchdog_on = 0;
-static unsigned int nmi_hz = HZ;
+static unsigned int nmi_hz;
 unsigned int nmi_perfctr_msr;  /* the MSR to reset in NMI handler */
 
 extern int logical_proc_id[];
@@ -227,6 +227,7 @@
 
 void __pminit setup_apic_nmi_watchdog(void)
 {
+    nmi_hz = HZ;       
     if (!nmi_watchdog)
         return;
 
diff -Nru a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h      2005-05-07 13:19:11 -07:00
+++ b/xen/include/asm-x86/config.h      2005-05-07 13:19:11 -07:00
@@ -23,7 +23,9 @@
 #define CONFIG_ACPI 1
 #define CONFIG_ACPI_BOOT 1
 
-#define HZ 100
+#ifndef __ASSEMBLY__
+extern unsigned int HZ;
+#endif
 
 #define OPT_CONSOLE_STR "com1,vga"
 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel