|
|
|
|
|
|
|
|
|
|
xen-devel
RE: [Xen-devel] Re: tsc_scale/cpu_khz imprecise and need fixing?
Dan Magenheimer wrote:
>>> I *think* the reason is that tsc_scale, which
>>> I believe is set only once per processor at startup
>>> on machines with constant/invariant TSC, is set
>>> imprecisely using init_pit_and_calibrate_tsc().
>>> I suspect the imprecision is compounded through
>>> the reciprocal operation. AND I wonder if an ill-timed
>>> power management event might render tsc_scale not
>>> just imprecise, but just plain wrong!
>>
>> The 50ms calibration period may not be long enough, we could
>> put the PIT in
>> square-wave mode instead and count 10 50ms periods...
>
> To support this, it appears that the value returned
> by init_pit_and_calibrate_tsc(), which is essentially
> "cpu_hz", varies by about 20K or more from boot to boot
> on the same hardware.
That explains why we use cpu_khz/1000(mHZ) to determin whether needs TSC soft
scaling for migration between two machines. That is to say, even if two
machine's tsc_khz are different in khz unit(calibration result), their real
frequency maybe same in real world. :)
Xiantao
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|