Re: [PATCH 5/5] cpufreq: Add support for actual freq

From: Dominik Brodowski
Date: Tue Mar 23 2010 - 10:41:59 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/