lkml.org 
[lkml]   [2010]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] cpufreq: Add support for actual freq
Hey,

On Tue, Mar 23, 2010 at 03:23:49PM +0100, Borislav Petkov wrote:
> > scaling_cur freq should show the frequency the kernel/cpufreq
> > subsystem thinks it's in.
>
> Well, we have also
> /sys/devices/system/cpu/cpu<NUM>/cpufreq/cpuinfo_cur_freq and it reads
> also policy->cur.

No. cpuinfo_cur_freq calls __cpufreq_get() which itself calls the driver's
->get() callback, which is exactly for determining the current frequency. I
assume CPUFREQ_CONST_LOOP is set, else we'd get into trouble; but as long as
that's the case I see no problem in using ->get() / cpuinfo_cur_freq to read
out the current actual frequency.

> Why not show the actual frequency in scaling_cur_freq then?

Quoting Documentation/cpu-freq/user-guide.txt :

cpuinfo_cur_freq : Current frequency of the CPU as obtained from
the hardware, in KHz. This is the frequency
the CPU actually runs at.

scaling_cur_freq : Current frequency of the CPU as determined by
the governor and cpufreq core, in KHz. This is
the frequency the kernel thinks the CPU runs
at.

So scaling_cur_freq may not be mis-used for this; cpuinfo_cur_freq may be
used for it, though. IMVHO.

Best,
Dominik


\
 
 \ /
  Last update: 2010-03-23 15:45    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site