lkml.org 
[lkml]   [2010]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/18] Make cpu_tsc_khz updates use local CPU
On 07/19/2010 10:53 PM, Avi Kivity wrote:
> On 07/19/2010 11:06 PM, Zachary Amsden wrote:
>>>> +static void tsc_khz_changed(void *data)
>>>> {
>>>> - /* nothing */
>>>> + struct cpufreq_freqs *freq = data;
>>>> + unsigned long khz = 0;
>>>> +
>>>> + if (data)
>>>> + khz = freq->new;
>>>> + else if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
>>>> + khz = cpufreq_quick_get(raw_smp_processor_id());
>>>> + if (!khz)
>>>> + khz = tsc_khz;
>>>> + __get_cpu_var(cpu_tsc_khz) = khz;
>>>> }
>>>
>>> Do we really need to cache cpufreq_quick_get()? If it's really
>>> quick, why not just use it everywhere instead of cacheing it? Not a
>>> comment on this patch.
>>>
>>
>>
>> If cpufreq is compiled in, but disabled, it returns zero, so we need
>> some sort of logic.
>
> Maybe it's better to put it into cpufreq_quick_get(). Inconsistent
> APIs that appear to work are bad.
>

I don't think it's quite so simple; cpufreq is platform independent and
tsc_khz is a platform specific export. It seems cpufreq is designed to
return zero when disabled and we're the unusual ones for wanting to use it.

Zach


\
 
 \ /
  Last update: 2010-07-20 23:59    [W:0.101 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site