diff -upr linux-2.6.13-rc3-orig/arch/i386/kernel/time.c linux-2.6.13-rc3/arch/i386/kernel/time.c --- linux-2.6.13-rc3-orig/arch/i386/kernel/time.c 2005-07-14 20:33:35.000000000 +0200 +++ linux-2.6.13-rc3/arch/i386/kernel/time.c 2005-07-15 04:02:50.000000000 +0200 @@ -75,6 +75,7 @@ int pit_latch_buggy; /* ext #include "do_timer.h" u64 jiffies_64 = INITIAL_JIFFIES; +u16 jiffies_increment = 1; EXPORT_SYMBOL(jiffies_64); @@ -481,3 +482,27 @@ void __init time_init(void) time_init_hook(); } + +static int __init jiffies_increment_setup(char *str) +{ + printk(KERN_NOTICE "setting up jiffies_increment : "); + if (str) { + printk("kernel_hz = %s, ", str); + } else { + printk("kernel_hz is unset, "); + } + if (!strncmp("100", str, 3)) { + jiffies_increment = 10; + printk("jiffies_increment set to 10, effective HZ will be 100\n"); + } else if (!strncmp("250", str, 3)) { + jiffies_increment = 4; + printk("jiffies_increment set to 4, effective HZ will be 250\n"); + } else { + jiffies_increment = 1; + printk("jiffies_increment set to 1, effective HZ will be 1000\n"); + } + + return 1; +} + +__setup("kernel_hz=", jiffies_increment_setup); diff -upr linux-2.6.13-rc3-orig/arch/i386/kernel/timers/timer_pm.c linux-2.6.13-rc3/arch/i386/kernel/timers/timer_pm.c --- linux-2.6.13-rc3-orig/arch/i386/kernel/timers/timer_pm.c 2005-07-14 20:33:35.000000000 +0200 +++ linux-2.6.13-rc3/arch/i386/kernel/timers/timer_pm.c 2005-07-15 02:59:39.000000000 +0200 @@ -176,7 +176,7 @@ static void mark_offset_pmtmr(void) /* compensate for lost ticks */ if (lost >= 2) - jiffies_64 += lost - 1; + jiffies_64 += (lost * jiffies_increment) - 1; /* don't calculate delay for first run, or if we've got less then a tick */ diff -upr linux-2.6.13-rc3-orig/arch/i386/kernel/timers/timer_tsc.c linux-2.6.13-rc3/arch/i386/kernel/timers/timer_tsc.c --- linux-2.6.13-rc3-orig/arch/i386/kernel/timers/timer_tsc.c 2005-07-14 20:33:35.000000000 +0200 +++ linux-2.6.13-rc3/arch/i386/kernel/timers/timer_tsc.c 2005-07-15 02:59:13.000000000 +0200 @@ -193,7 +193,7 @@ static void mark_offset_tsc_hpet(void) offset = hpet_readl(HPET_T0_CMP) - hpet_tick; if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) { int lost_ticks = (offset - hpet_last) / hpet_tick; - jiffies_64 += lost_ticks; + jiffies_64 += lost_ticks * jiffies_increment; } hpet_last = hpet_current; @@ -415,7 +415,7 @@ static void mark_offset_tsc(void) lost = delta/(1000000/HZ); delay = delta%(1000000/HZ); if (lost >= 2) { - jiffies_64 += lost-1; + jiffies_64 += (lost * jiffies_increment) - 1; /* sanity check to ensure we're not always losing ticks */ if (lost_count++ > 100) { @@ -448,7 +448,7 @@ static void mark_offset_tsc(void) * usec delta is > 90% # of usecs/tick) */ if (lost && abs(delay - delay_at_last_interrupt) > (900000/HZ)) - jiffies_64++; + jiffies_64 += jiffies_increment; } static int __init init_tsc(char* override) diff -upr linux-2.6.13-rc3-orig/include/linux/jiffies.h linux-2.6.13-rc3/include/linux/jiffies.h --- linux-2.6.13-rc3-orig/include/linux/jiffies.h 2005-06-17 21:48:29.000000000 +0200 +++ linux-2.6.13-rc3/include/linux/jiffies.h 2005-07-15 03:42:57.000000000 +0200 @@ -83,6 +83,7 @@ */ extern u64 __jiffy_data jiffies_64; extern unsigned long volatile __jiffy_data jiffies; +extern u16 jiffies_increment; #if (BITS_PER_LONG < 64) u64 get_jiffies_64(void); diff -upr linux-2.6.13-rc3-orig/kernel/timer.c linux-2.6.13-rc3/kernel/timer.c --- linux-2.6.13-rc3-orig/kernel/timer.c 2005-07-14 20:34:24.000000000 +0200 +++ linux-2.6.13-rc3/kernel/timer.c 2005-07-15 02:55:45.000000000 +0200 @@ -948,7 +948,7 @@ static inline void update_times(void) void do_timer(struct pt_regs *regs) { - jiffies_64++; + jiffies_64 += jiffies_increment; update_times(); }