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) ...@@ -67,11 +67,11 @@ static void mark_offset_cyclone(void)
/* lost tick compensation */ /* lost tick compensation */
delta = last_cyclone_low - delta; delta = last_cyclone_low - delta;
delta /=(CYCLONE_TIMER_FREQ/1000000); delta /= (CYCLONE_TIMER_FREQ/1000000);
delta += delay_at_last_interrupt; delta += delay_at_last_interrupt;
lost = delta/(1000000/HZ); lost = delta/(1000000/HZ);
delay = delta%(1000000/HZ); delay = delta%(1000000/HZ);
if(lost >= 2) if (lost >= 2)
jiffies += lost-1; jiffies += lost-1;
/* update the monotonic base value */ /* update the monotonic base value */
...@@ -83,10 +83,12 @@ static void mark_offset_cyclone(void) ...@@ -83,10 +83,12 @@ static void mark_offset_cyclone(void)
count = ((LATCH-1) - count) * TICK_SIZE; count = ((LATCH-1) - count) * TICK_SIZE;
delay_at_last_interrupt = (count + LATCH/2) / LATCH; 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++; jiffies++;
} }
......
...@@ -178,7 +178,7 @@ static void mark_offset_tsc(void) ...@@ -178,7 +178,7 @@ static void mark_offset_tsc(void)
delta += delay_at_last_interrupt; delta += delay_at_last_interrupt;
lost = delta/(1000000/HZ); lost = delta/(1000000/HZ);
delay = delta%(1000000/HZ); delay = delta%(1000000/HZ);
if(lost >= 2) if (lost >= 2)
jiffies += lost-1; jiffies += lost-1;
/* update the monotonic base value */ /* update the monotonic base value */
...@@ -190,10 +190,11 @@ static void mark_offset_tsc(void) ...@@ -190,10 +190,11 @@ static void mark_offset_tsc(void)
count = ((LATCH-1) - count) * TICK_SIZE; count = ((LATCH-1) - count) * TICK_SIZE;
delay_at_last_interrupt = (count + LATCH/2) / LATCH; delay_at_last_interrupt = (count + LATCH/2) / LATCH;
/* catch corner case where tick rollover /* catch corner case where tick rollover occured
* occured between tsc and pit reads * 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++; 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