lkml.org 
[lkml]   [2005]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH][x86-64] fix pit delay accounting in timer_interrupt()
From
Date
timer_interrupt() measures the delay from an interrupt to its handling
in a variable called 'delay', but accounts every unit of delay as 1/HZ
seconds, instead of 1/CLOCK_TICK_RATE seconds.

on ordinary cpus this doesn't matter as delay is usually zero, but on my
10MHz bochs cpu this causes divide overflows later on.

(patch against 2.6.9 but should apply)

Signed-off-by: Avi Kivity <avi@argo.co.il>


--- linux-2.6.9/arch/x86_64/kernel/time.c~time 2005-02-28 14:26:52.000000000 +0200
+++ linux-2.6.9/arch/x86_64/kernel/time.c 2005-02-28 14:28:46.000000000 +0200
@@ -409,7 +409,7 @@

monotonic_base += (tsc - vxtime.last_tsc)*1000000/cpu_khz ;

- vxtime.last_tsc = tsc - vxtime.quot * delay / vxtime.tsc_quot;
+ vxtime.last_tsc = tsc - vxtime.quot * delay / (LATCH * vxtime.tsc_quot);

if ((((tsc - vxtime.last_tsc) *
vxtime.tsc_quot) >> 32) < offset)
\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.088 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site