Bug 42924 - /proc/cpuinfo reports wrong frequency (compared to cpufreq-info)
Summary: /proc/cpuinfo reports wrong frequency (compared to cpufreq-info)
Status: CLOSED DOCUMENTED
Alias: None
Product: Power Management
Classification: Unclassified
Component: cpufreq (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: cpufreq
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-13 21:17 UTC by Martin Mokrejs
Modified: 2013-01-29 03:48 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.2.9
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Martin Mokrejs 2012-03-13 21:17:48 UTC
I do not understand why the first CPU core reports 800MHz whereas the acpi-cpufreq reports 2800MHz. My system is loaded with load 2.98 for several days and I wonder whether the first physical core (core_id 0) is really running at full speed:

# cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
stepping        : 7
microcode       : 0x25
cpu MHz         : 800.000
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 5586.47
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
stepping        : 7
microcode       : 0x25
cpu MHz         : 2801.000
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id         : 1
cpu cores       : 2
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 5587.21
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
stepping        : 7
microcode       : 0x25
cpu MHz         : 2801.000
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 5587.21
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
stepping        : 7
microcode       : 0x25
cpu MHz         : 2801.000
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id         : 1
cpu cores       : 2
apicid          : 3
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 5587.21
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

# cpufreq-info 
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 10.0 us.
  hardware limits: 800 MHz - 2.80 GHz
  available frequency steps: 2.80 GHz, 2.80 GHz, 2.40 GHz, 2.20 GHz, 2.00 GHz, 1.80 GHz, 1.60 GHz, 1.40 GHz, 1.20 GHz, 1000 MHz, 800 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 800 MHz and 2.80 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency is 2.80 GHz (asserted by call to hardware).
analyzing CPU 1:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 1
  maximum transition latency: 10.0 us.
  hardware limits: 800 MHz - 2.80 GHz
  available frequency steps: 2.80 GHz, 2.80 GHz, 2.40 GHz, 2.20 GHz, 2.00 GHz, 1.80 GHz, 1.60 GHz, 1.40 GHz, 1.20 GHz, 1000 MHz, 800 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 800 MHz and 2.80 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 2.80 GHz (asserted by call to hardware).
analyzing CPU 2:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 2
  maximum transition latency: 10.0 us.
  hardware limits: 800 MHz - 2.80 GHz
  available frequency steps: 2.80 GHz, 2.80 GHz, 2.40 GHz, 2.20 GHz, 2.00 GHz, 1.80 GHz, 1.60 GHz, 1.40 GHz, 1.20 GHz, 1000 MHz, 800 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 800 MHz and 2.80 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 2.80 GHz (asserted by call to hardware).
analyzing CPU 3:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 3
  maximum transition latency: 10.0 us.
  hardware limits: 800 MHz - 2.80 GHz
  available frequency steps: 2.80 GHz, 2.80 GHz, 2.40 GHz, 2.20 GHz, 2.00 GHz, 1.80 GHz, 1.60 GHz, 1.40 GHz, 1.20 GHz, 1000 MHz, 800 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 800 MHz and 2.80 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 2.80 GHz (asserted by call to hardware).
#
# turbostat -v
GenuineIntel 13 CPUID levels; family:model:stepping 0x6:2a:7 (6:42:7)
8 * 100 = 800 MHz max efficiency
28 * 100 = 2800 MHz TSC frequency
33 * 100 = 3300 MHz max turbo 4 active cores
33 * 100 = 3300 MHz max turbo 3 active cores
33 * 100 = 3300 MHz max turbo 2 active cores
35 * 100 = 3500 MHz max turbo 1 active cores
core CPU   %c0   GHz  TSC   %c1    %c3    %c6    %c7   %pc2   %pc3   %pc6   %pc7 
          67.96 3.33 2.79  19.33   2.21   5.58   4.92   0.00   0.00   0.00   0.00
   0   0  62.48 3.32 2.79  19.31   3.23   7.29   7.68   0.00   0.00   0.00   0.00
   0   2  60.93 3.32 2.79  20.87   3.23   7.29   7.68   0.00   0.00   0.00   0.00
   1   1  74.14 3.34 2.79  18.64   1.19   3.88   2.16   0.00   0.00   0.00   0.00
   1   3  74.28 3.34 2.79  18.49   1.19   3.88   2.16   0.00   0.00   0.00   0.00
core CPU   %c0   GHz  TSC   %c1    %c3    %c6    %c7   %pc2   %pc3   %pc6   %pc7 
          69.55 3.32 2.79  21.18   1.36   3.70   4.21   0.00   0.00   0.00   0.00
   0   0  79.85 3.32 2.79  13.71   1.33   2.06   3.05   0.00   0.00   0.00   0.00
   0   2  66.04 3.33 2.79  27.52   1.33   2.06   3.05   0.00   0.00   0.00   0.00
   1   1  61.95 3.31 2.79  25.95   1.38   5.35   5.37   0.00   0.00   0.00   0.00
   1   3  70.34 3.31 2.79  17.56   1.38   5.35   5.37   0.00   0.00   0.00   0.00
core CPU   %c0   GHz  TSC   %c1    %c3    %c6    %c7   %pc2   %pc3   %pc6   %pc7 
          60.82 3.32 2.79  30.52   0.80   3.29   4.57   0.00   0.00   0.00   0.00
   0   0  41.57 3.32 2.79  46.60   1.40   4.72   5.71   0.00   0.00   0.00   0.00
   0   2  72.65 3.31 2.79  15.51   1.40   4.72   5.71   0.00   0.00   0.00   0.00
   1   1  68.94 3.33 2.79  25.58   0.21   1.85   3.44   0.00   0.00   0.00   0.00
   1   3  60.11 3.33 2.79  34.40   0.21   1.85   3.44   0.00   0.00   0.00   0.00
core CPU   %c0   GHz  TSC   %c1    %c3    %c6    %c7   %pc2   %pc3   %pc6   %pc7 
          70.21 3.33 2.79  16.73   2.71   6.17   4.18   0.00   0.00   0.00   0.00
   0   0  62.55 3.34 2.79  25.35   2.55   5.99   3.56   0.00   0.00   0.00   0.00
   0   2  80.62 3.33 2.79   7.28   2.55   5.99   3.56   0.00   0.00   0.00   0.00
   1   1  71.51 3.33 2.79  14.45   2.88   6.36   4.79   0.00   0.00   0.00   0.00
   1   3  66.13 3.33 2.79  19.83   2.88   6.36   4.79   0.00   0.00   0.00   0.00
^C
#
Comment 1 Alan 2012-08-31 17:04:05 UTC
Thoughts Len ?
Comment 2 Len Brown 2013-01-29 03:48:21 UTC
turbostat tells the truth about what the HW is doing.
So in this case, all 4 threads (2 cores) are running at 3.3 GHz.

cpufreq is showing you 2.8 b/c that is what the OS requested.
It doesn't know that turbo HW can deliver 3.3 when it requests 2.801.

Also, on multi-core systems, the voltage is raised to support
the highest frequency request and all the cores run at that frequency.
Here 3 cpus asked for 2.8 and cpu0 asked for 800.  But cpu0 will run
at the same speed of the others even though it last requested less.

This is a longstanding problem with /proc/cpuinfo --
it is showing a cached request value, not an actual value.
The values in cpufreq are only slightly better...

Some day we may fix this, but probably only after
some major surgery (or wholesale replacement) of cpufreq.

Note You need to log in before you can comment on or make changes to this bug.