[PATCH] fix last_tsc calculation of PM timer

Jan Beulich jbeulich at novell.com
Wed May 10 17:03:49 CEST 2006


>>> Andi Kleen <ak at suse.de> 10.05.06 15:05 >>>
>On Wednesday 10 May 2006 14:46, Jan Beulich wrote:
>> The PM timer code updates vxtime.last_tsc, but this update was done
>> incorrectly in two ways:
>> - offset_delay being in microseconds requires multiplying with cpu_mhz
>>   rather than cpu_khz
>> - the multiplication of offset_delay and cpu_khz (both being 32-bit
>>   values) on most current CPUs would overflow (observed value of the
>>   delay was approximately 4000us, yielding an overflow for frequencies
>>   starting a little above 1GHz)
>
>If it was really that wrong we should have seen broken timing, no?

Probably not - I think the value computed wasn't used anywhere except maybe in the case of falling back to a different
timer.

Jan



More information about the discuss mailing list