From: john stultz - Whitespace fixes - Fix for the case where HZ != 1000 (pointed out by Mika Penttila). 25-akpm/arch/i386/kernel/timers/timer_cyclone.c | 12 +++++++----- 25-akpm/arch/i386/kernel/timers/timer_tsc.c | 9 +++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff -puN arch/i386/kernel/timers/timer_cyclone.c~lost-tick-HZ-fix arch/i386/kernel/timers/timer_cyclone.c --- 25/arch/i386/kernel/timers/timer_cyclone.c~lost-tick-HZ-fix Mon Apr 21 15:11:07 2003 +++ 25-akpm/arch/i386/kernel/timers/timer_cyclone.c Mon Apr 21 15:11:07 2003 @@ -67,11 +67,11 @@ static void mark_offset_cyclone(void) /* lost tick compensation */ delta = last_cyclone_low - delta; - delta /=(CYCLONE_TIMER_FREQ/1000000); + delta /= (CYCLONE_TIMER_FREQ/1000000); delta += delay_at_last_interrupt; lost = delta/(1000000/HZ); delay = delta%(1000000/HZ); - if(lost >= 2) + if (lost >= 2) jiffies += lost-1; /* update the monotonic base value */ @@ -83,10 +83,12 @@ static void mark_offset_cyclone(void) count = ((LATCH-1) - count) * TICK_SIZE; delay_at_last_interrupt = (count + LATCH/2) / LATCH; - /* catch corner case where tick rollover - * occured between cyclone and pit reads + + /* catch corner case where tick rollover occured + * between cyclone and pit reads (as noted when + * usec delta is > 90% # of usecs/tick) */ - if(abs(delay - delay_at_last_interrupt) > 900) + if (abs(delay - delay_at_last_interrupt) > (900000/HZ)) jiffies++; } diff -puN arch/i386/kernel/timers/timer_tsc.c~lost-tick-HZ-fix arch/i386/kernel/timers/timer_tsc.c --- 25/arch/i386/kernel/timers/timer_tsc.c~lost-tick-HZ-fix Mon Apr 21 15:11:07 2003 +++ 25-akpm/arch/i386/kernel/timers/timer_tsc.c Mon Apr 21 15:11:07 2003 @@ -178,7 +178,7 @@ static void mark_offset_tsc(void) delta += delay_at_last_interrupt; lost = delta/(1000000/HZ); delay = delta%(1000000/HZ); - if(lost >= 2) + if (lost >= 2) jiffies += lost-1; /* update the monotonic base value */ @@ -190,10 +190,11 @@ static void mark_offset_tsc(void) count = ((LATCH-1) - count) * TICK_SIZE; delay_at_last_interrupt = (count + LATCH/2) / LATCH; - /* catch corner case where tick rollover - * occured between tsc and pit reads + /* catch corner case where tick rollover occured + * between tsc and pit reads (as noted when + * usec delta is > 90% # of usecs/tick) */ - if(abs(delay - delay_at_last_interrupt) > 900) + if (abs(delay - delay_at_last_interrupt) > (900000/HZ)) jiffies++; } _