cpufreq.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cpufreq-info and acpi-cpufreq: reporting MSR_IA32_PERF_CTL as "actual frequency"
@ 2014-11-25 17:21 Magdalena Dobosz
  2014-11-26  6:07 ` Viresh Kumar
  0 siblings, 1 reply; 7+ messages in thread
From: Magdalena Dobosz @ 2014-11-25 17:21 UTC (permalink / raw)
  To: CPUFREQ; +Cc: Ross Lagerwall, rjw, viresh.kumar

Hi,
I was analyzing the code and behaviour of cpufrequtils (kernel 3.13).
I noticed that the value reported by cpufreq-info as the frequency
"asserted by call to hardware" (exported to sysfs as
"cpuinfo_cur_freq") is always the same as the value reported as the
frequency requested by a governor (exported to sysfs as "freq", stored
in policy->cur).
It was not the case for kernel 3.2 (these two values tend to differ).

I found a reason: while using acpi-cpufreq driver, the value reported
as hardware frequency is retrieved using  get_cur_freq_on_cpu function
(defined in acpi-cpufreq). Now, in kernel version 3.2 this function
reads a value from MSR_IA32_PERF_STATUS, while in kernel 3.13 it reads
MSR_IA32_PERF_CTL.
It is a result of the patch shown below:
https://lists.ubuntu.com/archives/kernel-team/2013-June/029493.html

It looks like a bug for me - we take a requested frequency (control
register) and we report it as "cpuinfo_cur_freq - Current frequency of
the CPU as obtained from the hardware, in KHz. This is the frequency
the CPU actually runs at." (as desribed in cpufrequtils documentation:
https://www.kernel.org/doc/Documentation/cpu-freq/user-guide.txt". I
believe we should read status register (MSR_IA32_PERF_STATUS) instead.

Best regards,
Magdalena Dobosz

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-03-14 17:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-25 17:21 cpufreq-info and acpi-cpufreq: reporting MSR_IA32_PERF_CTL as "actual frequency" Magdalena Dobosz
2014-11-26  6:07 ` Viresh Kumar
2014-11-26 15:29   ` Dirk Brandewie
2014-11-26 20:41     ` Magdalena Dobosz
2014-11-26 22:37       ` Rafael J. Wysocki
2014-11-27 16:38         ` Magdalena Dobosz
2015-03-14 17:18           ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).