Commit ba0846e2 authored by Andrew Morton's avatar Andrew Morton Committed by Christoph Hellwig

[PATCH] lost_tick fixes

From: john stultz <johnstul@us.ibm.com>

- Whitespace fixes

- Fix for the case where HZ != 1000 (pointed out by Mika Penttila).
parent 75ab6eef
......@@ -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++;
}
......
......@@ -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++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment