There's some really badly broken software out there that is entirely dependant on HZ for its maximum performance. Raise the maximum HZ value to some higher and slightly unreasonable values up to some higher and completely obscene values. Signed-off-by: Con Kolivas --- arch/i386/kernel/cpu/proc.c | 2 - arch/i386/kernel/smpboot.c | 2 - arch/x86_64/kernel/setup.c | 2 - include/linux/jiffies.h | 6 +++ include/linux/nfsd/stats.h | 4 +- include/net/inet_timewait_sock.h | 10 ++++-- include/net/pkt_sched.h | 8 ++++ init/calibrate.c | 6 +-- kernel/Kconfig.hz | 64 +++++++++++++++++++++++++++++++++++++++ 9 files changed, 92 insertions(+), 12 deletions(-) Index: linux-2.6.21-ck2/include/linux/jiffies.h =================================================================== --- linux-2.6.21-ck2.orig/include/linux/jiffies.h 2007-05-14 19:49:18.000000000 +1000 +++ linux-2.6.21-ck2/include/linux/jiffies.h 2007-05-14 19:49:57.000000000 +1000 @@ -29,6 +29,12 @@ # define SHIFT_HZ 9 #elif HZ >= 768 && HZ < 1536 # define SHIFT_HZ 10 +#elif HZ >= 1536 && HZ < 3072 +# define SHIFT_HZ 11 +#elif HZ >= 3072 && HZ < 6144 +# define SHIFT_HZ 12 +#elif HZ >= 6144 && HZ < 12288 +# define SHIFT_HZ 13 #else # error You lose. #endif Index: linux-2.6.21-ck2/kernel/Kconfig.hz =================================================================== --- linux-2.6.21-ck2.orig/kernel/Kconfig.hz 2007-05-14 19:49:57.000000000 +1000 +++ linux-2.6.21-ck2/kernel/Kconfig.hz 2007-05-14 19:49:57.000000000 +1000 @@ -45,6 +45,63 @@ choice 1000 Hz is the preferred choice for desktop systems and other systems requiring fast interactive responses to events. + config HZ_1500 + bool "1500 HZ" + help + 1500 Hz is an insane value to use to run broken software that is Hz + limited. + + Being over 1000, driver breakage is likely. + + config HZ_2000 + bool "2000 HZ" + help + 2000 Hz is an insane value to use to run broken software that is Hz + limited. + + Being over 1000, driver breakage is likely. + + config HZ_3000 + bool "3000 HZ" + help + 3000 Hz is an insane value to use to run broken software that is Hz + limited. + + Being over 1000, driver breakage is likely. + + config HZ_4000 + bool "4000 HZ" + help + 4000 Hz is an insane value to use to run broken software that is Hz + limited. + + Being over 1000, driver breakage is likely. + + config HZ_5000 + bool "5000 HZ" + help + 5000 Hz is an obscene value to use to run broken software that is Hz + limited. + + Being over 1000, driver breakage is likely. + + config HZ_7500 + bool "7500 HZ" + help + 7500 Hz is an obscene value to use to run broken software that is Hz + limited. + + Being over 1000, driver breakage is likely. + + config HZ_10000 + bool "10000 HZ" + help + 10000 Hz is an obscene value to use to run broken software that is Hz + limited. + + Being over 1000, driver breakage is likely. + + endchoice config HZ @@ -53,4 +110,11 @@ config HZ default 250 if HZ_250_NODEFAULT default 300 if HZ_300 default 1000 if HZ_1000 + default 1500 if HZ_1500 + default 2000 if HZ_2000 + default 3000 if HZ_3000 + default 4000 if HZ_4000 + default 5000 if HZ_5000 + default 7500 if HZ_7500 + default 10000 if HZ_10000 Index: linux-2.6.21-ck2/include/net/inet_timewait_sock.h =================================================================== --- linux-2.6.21-ck2.orig/include/net/inet_timewait_sock.h 2007-05-14 19:49:18.000000000 +1000 +++ linux-2.6.21-ck2/include/net/inet_timewait_sock.h 2007-05-14 19:49:57.000000000 +1000 @@ -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 > 4096 -# error Unsupported: HZ <= 16 or HZ > 4096 +#if HZ <= 16 || HZ > 16384 +# error Unsupported: HZ <= 16 or HZ > 16384 #elif HZ <= 32 # define INET_TWDR_RECYCLE_TICK (5 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG) #elif HZ <= 64 @@ -54,8 +54,12 @@ struct inet_hashinfo; # define INET_TWDR_RECYCLE_TICK (10 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG) #elif HZ <= 2048 # define INET_TWDR_RECYCLE_TICK (11 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG) -#else +#elif HZ <= 4096 # 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 +# define INET_TWDR_RECYCLE_TICK (14 + 2 - INET_TWDR_RECYCLE_SLOTS_LOG) #endif /* TIME_WAIT reaping mechanism. */ Index: linux-2.6.21-ck2/include/net/pkt_sched.h =================================================================== --- linux-2.6.21-ck2.orig/include/net/pkt_sched.h 2007-05-14 19:49:18.000000000 +1000 +++ linux-2.6.21-ck2/include/net/pkt_sched.h 2007-05-14 19:49:57.000000000 +1000 @@ -78,8 +78,14 @@ typedef long psched_tdiff_t; #define PSCHED_JSCALE 12 #elif HZ >= 384 && HZ < 768 #define PSCHED_JSCALE 11 -#elif HZ >= 768 +#elif HZ >= 768 && HZ < 1536 #define PSCHED_JSCALE 10 +#elif HZ >= 1536 && HZ < 3072 +#define PSCHED_JSCALE 9 +#elif HZ >= 3072 && HZ < 6144 +#define PSCHED_JSCALE 8 +#else +#define PSCHED_JSCALE 7 #endif #define PSCHED_GET_TIME(stamp) ((stamp) = (get_jiffies_64()<loops_per_jiffy/(500000/HZ), - (c->loops_per_jiffy/(5000/HZ)) % 100); + (c->loops_per_jiffy * 10/(50000/HZ)) % 100); seq_printf(m, "clflush size\t: %u\n\n", c->x86_clflush_size); return 0; Index: linux-2.6.21-ck2/arch/i386/kernel/smpboot.c =================================================================== --- linux-2.6.21-ck2.orig/arch/i386/kernel/smpboot.c 2007-05-14 19:49:18.000000000 +1000 +++ linux-2.6.21-ck2/arch/i386/kernel/smpboot.c 2007-05-14 19:49:57.000000000 +1000 @@ -1134,7 +1134,7 @@ static void __init smp_boot_cpus(unsigne "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", cpucount+1, bogosum/(500000/HZ), - (bogosum/(5000/HZ))%100); + (bogosum * 10/(50000/HZ))%100); Dprintk("Before bogocount - setting activated=1.\n"); Index: linux-2.6.21-ck2/include/linux/nfsd/stats.h =================================================================== --- linux-2.6.21-ck2.orig/include/linux/nfsd/stats.h 2007-05-14 19:49:18.000000000 +1000 +++ linux-2.6.21-ck2/include/linux/nfsd/stats.h 2007-05-14 19:49:57.000000000 +1000 @@ -35,8 +35,8 @@ struct nfsd_stats { }; -/* thread usage wraps very million seconds (approx one fortnight) */ -#define NFSD_USAGE_WRAP (HZ*1000000) +/* thread usage wraps every one hundred thousand seconds (approx one day) */ +#define NFSD_USAGE_WRAP (HZ*100000) #ifdef __KERNEL__ Index: linux-2.6.21-ck2/arch/x86_64/kernel/setup.c =================================================================== --- linux-2.6.21-ck2.orig/arch/x86_64/kernel/setup.c 2007-05-14 19:49:18.000000000 +1000 +++ linux-2.6.21-ck2/arch/x86_64/kernel/setup.c 2007-05-14 19:49:57.000000000 +1000 @@ -1053,7 +1053,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/(5000/HZ)) % 100); + (c->loops_per_jiffy * 10/(50000/HZ)) % 100); if (c->x86_tlbsize > 0) seq_printf(m, "TLB size\t: %d 4K pages\n", c->x86_tlbsize);