[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/tsc: Fix diagnostics for TSC frequency



On 05.08.2020 18:25, Andrew Cooper wrote:
> On 05/08/2020 15:54, Jan Beulich wrote:
>> On 05.08.2020 16:18, Andrew Cooper wrote:
>>> --- a/xen/arch/x86/cpu/intel.c
>>> +++ b/xen/arch/x86/cpu/intel.c
>>> @@ -396,14 +396,14 @@ static void intel_log_freq(const struct cpuinfo_x86 
>>> *c)
>>>  
>>>              val *= ebx;
>>>              do_div(val, eax);
>>> -            printk("CPU%u: TSC: %uMHz * %u / %u = %LuMHz\n",
>>> +            printk("CPU%u: TSC: %u Hz * %u / %u = %Lu Hz\n",
>>>                     smp_processor_id(), ecx, ebx, eax, val);
>> For this one I wonder whether ecx wouldn't better be scaled down to
>> kHz, and val down to MHz.
> 
> That depends on whether we will lose precision in the process.

I don't think losing the last three digits for the base clock and
the last six ones of the calculated value would do any harm at all.
All it would do (imo) is to make the numbers better readable (due
less counting, and hence less possible counting mistakes).

> In principle we can, given ecx's unit of Hz, so I'd be tempted to leave
> it as is.

Well, okay.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.