Let's just take the HZ options up to truly ridiculous levels.

Signed-off-by: Con Kolivas <kernel@kolivas.org>

---
 arch/i386/kernel/cpu/proc.c      |    2 +-
 arch/i386/kernel/smpboot.c       |    2 +-
 arch/x86_64/kernel/setup.c       |    2 +-
 include/linux/jiffies.h          |    8 ++++++++
 include/linux/nfsd/stats.h       |    4 ++--
 include/net/inet_timewait_sock.h |   12 +++++++++---
 include/net/pkt_sched.h          |   10 +++++++++-
 init/calibrate.c                 |    6 +++---
 kernel/Kconfig.hz                |   30 +++++++++++++++++++++++++++++-
 9 files changed, 63 insertions(+), 13 deletions(-)

Index: linux-2.6.20-ck1/arch/i386/kernel/cpu/proc.c
===================================================================
--- linux-2.6.20-ck1.orig/arch/i386/kernel/cpu/proc.c	2007-02-20 13:16:48.000000000 +1100
+++ linux-2.6.20-ck1/arch/i386/kernel/cpu/proc.c	2007-02-20 13:53:35.000000000 +1100
@@ -154,7 +154,7 @@ static int show_cpuinfo(struct seq_file 
 
 	seq_printf(m, "\nbogomips\t: %lu.%02lu\n",
 		     c->loops_per_jiffy/(500000/HZ),
-		     (c->loops_per_jiffy * 10/(50000/HZ)) % 100);
+		     (c->loops_per_jiffy * 100/(500000/HZ)) % 100);
 	seq_printf(m, "clflush size\t: %u\n\n", c->x86_clflush_size);
 
 	return 0;
Index: linux-2.6.20-ck1/arch/i386/kernel/smpboot.c
===================================================================
--- linux-2.6.20-ck1.orig/arch/i386/kernel/smpboot.c	2007-02-20 13:16:48.000000000 +1100
+++ linux-2.6.20-ck1/arch/i386/kernel/smpboot.c	2007-02-20 13:54:21.000000000 +1100
@@ -1286,7 +1286,7 @@ static void __init smp_boot_cpus(unsigne
 		"Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
 		cpucount+1,
 		bogosum/(500000/HZ),
-		(bogosum * 10/(50000/HZ))%100);
+		(bogosum * 100/(500000/HZ))%100);
 	
 	Dprintk("Before bogocount - setting activated=1.\n");
 
Index: linux-2.6.20-ck1/arch/x86_64/kernel/setup.c
===================================================================
--- linux-2.6.20-ck1.orig/arch/x86_64/kernel/setup.c	2007-02-20 13:16:48.000000000 +1100
+++ linux-2.6.20-ck1/arch/x86_64/kernel/setup.c	2007-02-20 13:54:40.000000000 +1100
@@ -1168,7 +1168,7 @@ static int show_cpuinfo(struct seq_file 
 		
 	seq_printf(m, "\nbogomips\t: %lu.%02lu\n",
 		   c->loops_per_jiffy/(500000/HZ),
-		   (c->loops_per_jiffy * 10/(50000/HZ)) % 100);
+		   (c->loops_per_jiffy * 100/(500000/HZ)) % 100);
 
 	if (c->x86_tlbsize > 0) 
 		seq_printf(m, "TLB size\t: %d 4K pages\n", c->x86_tlbsize);
Index: linux-2.6.20-ck1/include/linux/jiffies.h
===================================================================
--- linux-2.6.20-ck1.orig/include/linux/jiffies.h	2007-02-20 13:16:48.000000000 +1100
+++ linux-2.6.20-ck1/include/linux/jiffies.h	2007-02-20 13:20:53.000000000 +1100
@@ -35,6 +35,14 @@
 # define SHIFT_HZ	12
 #elif HZ >= 6144 && HZ < 12288
 # define SHIFT_HZ	13
+#elif HZ >= 12288 && HZ < 24576
+# define SHIFT_HZ	14
+#elif HZ >= 24576 && HZ < 49152
+# define SHIFT_HZ	15
+#elif HZ >= 49152 && HZ < 98304
+# define SHIFT_HZ	16
+#elif HZ >= 98304 && HZ < 196608
+# define SHIFT_HZ	17
 #else
 # error You lose.
 #endif
Index: linux-2.6.20-ck1/include/linux/nfsd/stats.h
===================================================================
--- linux-2.6.20-ck1.orig/include/linux/nfsd/stats.h	2007-02-20 13:16:48.000000000 +1100
+++ linux-2.6.20-ck1/include/linux/nfsd/stats.h	2007-02-20 13:50:00.000000000 +1100
@@ -35,8 +35,8 @@ struct nfsd_stats {
 
 };
 
-/* thread usage wraps every one hundred thousand seconds (approx one day) */
-#define	NFSD_USAGE_WRAP	(HZ*100000)
+/* thread usage wraps depends on HZ */
+#define	NFSD_USAGE_WRAP	(1000000000)
 
 #ifdef __KERNEL__
 
Index: linux-2.6.20-ck1/include/net/inet_timewait_sock.h
===================================================================
--- linux-2.6.20-ck1.orig/include/net/inet_timewait_sock.h	2007-02-20 13:16:48.000000000 +1100
+++ linux-2.6.20-ck1/include/net/inet_timewait_sock.h	2007-02-20 13:48:43.000000000 +1100
@@ -38,8 +38,8 @@ struct inet_hashinfo;
  * If time > 4sec, it is "slow" path, no recycling is required,
  * so that we select tick to get range about 4 seconds.
  */
-#if HZ <= 16 || HZ > 16384
-# error Unsupported: HZ <= 16 or HZ > 16384
+#if HZ <= 16 || HZ > 100000
+# error Unsupported: HZ <= 16 or HZ > 100000
 #elif HZ <= 32
 # define INET_TWDR_RECYCLE_TICK (5 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
 #elif HZ <= 64
@@ -58,8 +58,14 @@ struct inet_hashinfo;
 # define INET_TWDR_RECYCLE_TICK (12 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
 #elif HZ <= 8192
 # define INET_TWDR_RECYCLE_TICK (13 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
-#else
+#elif HZ <= 16384
 # define INET_TWDR_RECYCLE_TICK (14 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
+#elif HZ <= 32768
+# define INET_TWDR_RECYCLE_TICK (15+ 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
+#elif HZ <= 65536
+# define INET_TWDR_RECYCLE_TICK (16+ 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
+#else
+# define INET_TWDR_RECYCLE_TICK (17 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG)
 #endif
 
 /* TIME_WAIT reaping mechanism. */
Index: linux-2.6.20-ck1/include/net/pkt_sched.h
===================================================================
--- linux-2.6.20-ck1.orig/include/net/pkt_sched.h	2007-02-20 13:16:48.000000000 +1100
+++ linux-2.6.20-ck1/include/net/pkt_sched.h	2007-02-20 13:51:40.000000000 +1100
@@ -84,8 +84,16 @@ typedef long	psched_tdiff_t;
 #define PSCHED_JSCALE 9
 #elif HZ >= 3072 && HZ < 6144
 #define PSCHED_JSCALE 8
-#else
+#elif HZ >= 6144 && HZ < 12288
 #define PSCHED_JSCALE 7
+#elif HZ >= 12288 && HZ < 24576
+#define PSCHED_JSCALE 6
+#elif HZ >= 24576 && HZ < 49152
+#define PSCHED_JSCALE 5
+#elif HZ >= 49152 && HZ < 98304
+#define PSCHED_JSCALE 4
+#else
+#define PSCHED_JSCALE 3
 #endif
 
 #define PSCHED_GET_TIME(stamp) ((stamp) = (get_jiffies_64()<<PSCHED_JSCALE))
Index: linux-2.6.20-ck1/init/calibrate.c
===================================================================
--- linux-2.6.20-ck1.orig/init/calibrate.c	2007-02-20 13:16:48.000000000 +1100
+++ linux-2.6.20-ck1/init/calibrate.c	2007-02-20 13:53:08.000000000 +1100
@@ -122,12 +122,12 @@ void __devinit calibrate_delay(void)
 		printk("Calibrating delay loop (skipped)... "
 			"%lu.%02lu BogoMIPS preset\n",
 			loops_per_jiffy/(500000/HZ),
-			(loops_per_jiffy * 10/(50000/HZ)) % 100);
+			(loops_per_jiffy * 100/(500000/HZ)) % 100);
 	} else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) {
 		printk("Calibrating delay using timer specific routine.. ");
 		printk("%lu.%02lu BogoMIPS (lpj=%lu)\n",
 			loops_per_jiffy/(500000/HZ),
-			(loops_per_jiffy * 10/(50000/HZ)) % 100,
+			(loops_per_jiffy * 100/(500000/HZ)) % 100,
 			loops_per_jiffy);
 	} else {
 		loops_per_jiffy = (1<<12);
@@ -166,7 +166,7 @@ void __devinit calibrate_delay(void)
 		/* Round the value and print it */
 		printk("%lu.%02lu BogoMIPS (lpj=%lu)\n",
 			loops_per_jiffy/(500000/HZ),
-			(loops_per_jiffy * 10/(50000/HZ)) % 100,
+			(loops_per_jiffy * 100/(500000/HZ)) % 100,
 			loops_per_jiffy);
 	}
 
Index: linux-2.6.20-ck1/kernel/Kconfig.hz
===================================================================
--- linux-2.6.20-ck1.orig/kernel/Kconfig.hz	2007-02-20 13:16:48.000000000 +1100
+++ linux-2.6.20-ck1/kernel/Kconfig.hz	2007-02-20 13:57:48.000000000 +1100
@@ -131,6 +131,32 @@ choice
 
 	 Being over 1000, driver breakage is likely.
 
+	config HZ_24858
+		bool "24858 HZ"
+	help
+	 24858 Hz is a complete lunatic value to use to run broken software
+	 that is Hz limited, which is chosen to retain accurate clock
+	 performance based on the internal PIT timer.
+
+	 Being over 10000, driver breakage is virtually guaranteed.
+
+	config HZ_49716
+		bool "49716 HZ"
+	help
+	 49716 Hz is a complete lunatic value to use to run broken software
+	 that is Hz limited, which is chosen to retain accurate clock
+	 performance based on the internal PIT timer.
+
+	 Being over 10000, driver breakage is virtually guaranteed.
+
+	config HZ_99432
+		bool "99432 HZ"
+	help
+	 99432 Hz is a complete lunatic value to use to run broken software
+	 that is Hz limited, which is chosen to retain accurate clock
+	 performance based on the internal PIT timer.
+
+	 Being over 10000, driver breakage is virtually guaranteed.
 
 endchoice
 
@@ -150,4 +176,6 @@ config HZ
 	default 6897 if HZ_6897
 	default 8286 if HZ_8286
 	default 9861 if HZ_9861
-
+	default 24858 if HZ_24858
+	default 49716 if HZ_49716
+	default 99432 if HZ_99432
