fix pit delay accounting in timer_interrupt()
PATCH 1/1 fix pit delay accounting in timer_interrupt()
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 <[email protected]>
arch/x86_64/kernel/time.c renamed from arch/x86_64/kernel/time.c~time +1 -1
@@ -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)