Wrong real CPU frequency (Core i5 processor)

Hi all. I have a Core i5-2520M processor and openSUSE 12.1.

The processor is badly managed by the Linux kernel : it is never less than 1.8 GHz:

$ cat /proc/cpuinfo | grep MHz
cpu MHz        : 800.000
cpu MHz        : 800.000
cpu MHz        : 800.000
cpu MHz        : 800.000
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ondemand
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
2501000 2500000 2200000 2000000 1800000 1600000 1400000 1200000 1000000 800000
$ cat /sys/devices/system/cpu/cpu0/cpufreq/bios_limit
2501000
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
800000

Everything seems OK. The governor asked the processor to switch to 800 MHz when idle. But with a root access, despite this information, I see that the CPU is never under 1.8 GHz (the real frequency varies between 1.8GHz and 2.5GHz). Example:

$ sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
1800000

$ sudo cpupower -c 0-3 monitor
    |Nehalem                    || SandyBridge        || Mperf              || Idle_Stats                       
CPU | C3   | C6   | PC3  | PC6  || C7   | PC2  | PC7  || C0   | Cx   | Freq || POLL | C1-S | C3-S | C6-S | C7-S 
   0|  0,68|  0,00|  0,00|  0,00|| 92,49|  0,00|  0,00||  3,46| 96,54|  **1800**||  0,00|  1,89|  0,49|  0,00| 94,18
   1|  0,68|  0,00|  0,00|  0,00|| 92,49|  0,00|  0,00||  0,71| 99,29|  **1800**||  0,00|  0,76|  0,25|  0,00| 98,29
   2|  0,72|  0,08|  0,00|  0,00|| 96,56|  0,00|  0,00||  0,39| 99,61|  **1800**||  0,00|  0,40|  0,42|  0,00| 98,80
   3|  0,72|  0,08|  0,00|  0,00|| 96,56|  0,00|  0,00||  0,98| 99,02|  **1775**||  0,00|  0,40|  0,40|  0,08| 98,13

And i7z confirms.

I think this is a bug in modules in kernel-desktop.

The kernel-desktops 3.1.0-1.2-desktop and 3.1.3-2-desktop (from the standard 12.1 repository) have the same issue. When I boot on kernel-desktop-base, i7z reports a lower frequency (around 1200 MHz, not perfect but better), but the Core i5 graphic card is not recognized so I’m back to kernel-desktop.

On 11/30/2011 10:16 AM, artopage wrote:
> I have a Core i5-2520M processor

what does Intel report is the range of frequencies available for that
processor’s scaling/steping??

i ask, because i have a modern, but less capable Intel processor whose
minimum available MHz is 1000…


DD http://tinyurl.com/DD-Hardware
openSUSE®, the “German Engineered Automobiles” of operating systems!

Intel reports nothing about the minimum frequency (see here).

But I found a guy with the same laptop than me, under ArchLinux. Its CPU frequency is 800 MHz when idle.

On 11/30/2011 12:16 PM, artopage wrote:
> But I found a guy with the same laptop than me, under ArchLinux. ‘Its
> CPU frequency is 800 MHz’ (http://tinyurl.com/7letfpy) when idle.

same laptop maybe, but he says his CPU is an i7z, which is (afaik) a
different critter…he wrote “I’ve also tried checking the real
frequencies with i7z and I see clocks around 800-900 MHz”

again, i suggest you find where Intel specifies the variance available
with Linux…

or, if ArchLinux does what you need, then use it…

or figure out what kernel/parameters are being used in Arch…

oh, and i just remembered something–one of the moderators in these fora
wrote a script which may help you, see

http://forums.opensuse.org/blogs/jdmcdaniel3/c-f-u-cpu-frequency-utilitiy-version-1-10-use-cpufrequtils-package-40/

his was the only way i could get my cpu down to 1 GHz…good luck.


DD http://tinyurl.com/DD-Caveat
openSUSE®, the “German Engineered Automobiles” of operating systems!

I prefer openSUSE. :slight_smile:

i7z is a reporting tool for Core i7, i3 and i5. I use it too. Great tool.

Thank you for your link. Cpufreq has been removed when I installed cpupower. But I tried it and it doesn’t solve the issue.

On 11/30/2011 03:16 AM, artopage wrote:
>
> Hi all. I have a Core i5-2520M processor and openSUSE 12.1.
>
> The processor is badly managed by the Linux kernel : it is never less
> than 1.8 GHz:
>
>
> Code:
> --------------------
> $ cat /proc/cpuinfo | grep MHz
> cpu MHz : 800.000
> cpu MHz : 800.000
> cpu MHz : 800.000
> cpu MHz : 800.000

Why do you say it is never less that 1.8 GHz? Your output above shows that all 4
are idling at 800 MHz!

It appears not to be broken! Why do you want to fix it?

Please read the entire message. The real frequency is not 800 MHz. The content of cpuinfo lies.

Here are the output when i7z is starting:

$ sudo ./i7z
i7z DEBUG: i7z version: svn-r50-(1-1-2011)
i7z DEBUG: Found Intel Processor
i7z DEBUG:    Stepping 7
i7z DEBUG:    Model a
i7z DEBUG:    Family 6
i7z DEBUG:    Processor Type 0
i7z DEBUG:    Extended Model 2
i7z DEBUG: msr = Model Specific Register
i7z DEBUG: Detected an i7 - 32nm
i7z DEBUG: msr device files exist /dev/cpu/*/msr
i7z DEBUG: You have write permissions to msr device files

------------------------------
--[core id]--- Other information
-------------------------------------
--[0] Processor number 0
--[0] Socket number/Hyperthreaded Sibling number  0,1
--[0] Core id number 0
--[0] Display core in i7z Tool: Yes

--[1] Processor number 1
--[1] Socket number/Hyperthreaded Sibling number  0,0
--[1] Core id number 0
--[1] Display core in i7z Tool: No

--[2] Processor number 2
--[2] Socket number/Hyperthreaded Sibling number  0,3
--[2] Core id number 1
--[2] Display core in i7z Tool: Yes

--[3] Processor number 3
--[3] Socket number/Hyperthreaded Sibling number  0,2
--[3] Core id number 1
--[3] Display core in i7z Tool: No

Socket-0 [num of cpus 2 physical 2 logical 4] 0,2,
Socket-1 [num of cpus 0 physical 0 logical 0] 
i7z DEBUG: Single Socket Detected
i7z DEBUG: In i7z Single_Socket()
i7z DEBUG: guessing Sandy Bridge

And a snapshot of i7z when running:

Cpu speed from cpuinfo 2491.00Mhz
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc
Linux's inbuilt cpu_khz code emulated now
True Frequency (without accounting Turbo) 2491 MHz
  CPU Multiplier 25x || Bus clock frequency (BCLK) 99.64 MHz

Socket [0] - [physical cores=2, logical cores=4, max online cores ever=2]
  TURBO ENABLED on 2 Cores, Hyper Threading ON
  True Frequency 2590.64 MHz (99.64 x [26])
  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  32x/30x/30x/30x
  Current Frequency 1893.86 MHz [99.64 x 19.01] (Max of below)
        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp
        Core 1 [0]:       **1893.21** (19.00x)      6.13    19.4    3.13       1    71.8    52
        Core 2 [2]:       **1893.86** (19.01x)       2.1    3.98       1       1    92.4    50


C0 = Processor running without halting
C1 = Processor running with halts (States >C0 are power saver)
C3 = Cores running with PLL turned off and core cache turned off
C6 = Everything in C3 + core state saved to last level cache
  Above values in table are in percentage over the last 1 sec
[core-id] refers to core-id number in /proc/cpuinfo
'Garbage Values' message printed when garbage values are read
  Ctrl+C to exit

On Wed, 30 Nov 2011 16:36:03 +0000, artopage wrote:

> Please read the entire message. The real frequency is not 800 MHz. The
> content of cpuinfo lies.

What makes you think cpuinfo is lying and that i7z is telling the truth?

Are you sure that nothing is causing the CPU to need to do something when
you run i7z?

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On 11/30/2011 11:36 AM, Jim Henderson wrote:
> On Wed, 30 Nov 2011 16:36:03 +0000, artopage wrote:
>
>> Please read the entire message. The real frequency is not 800 MHz. The
>> content of cpuinfo lies.
>
> What makes you think cpuinfo is lying and that i7z is telling the truth?
>
> Are you sure that nothing is causing the CPU to need to do something when
> you run i7z?

I would certainly trust the kernel over some user-space tool. Check the cpu
usage with top with and without i7z.

On Wed, 30 Nov 2011 20:37:48 +0000, Larry Finger wrote:

> On 11/30/2011 11:36 AM, Jim Henderson wrote:
>> On Wed, 30 Nov 2011 16:36:03 +0000, artopage wrote:
>>
>>> Please read the entire message. The real frequency is not 800 MHz. The
>>> content of cpuinfo lies.
>>
>> What makes you think cpuinfo is lying and that i7z is telling the
>> truth?
>>
>> Are you sure that nothing is causing the CPU to need to do something
>> when you run i7z?
>
> I would certainly trust the kernel over some user-space tool. Check the
> cpu usage with top with and without i7z.

That’s my thinking as well - I found an ‘i7z’ utility on Google Code. If
it came from Intel, that’d be a different story…

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Thank you for your responses. I think i7z is lightweight. I see no change when it’s running. And I doesn’t see it with the command “top”.

top - 10:38:51 up 20 min,  5 users,  load average: 0.00, 0.04, 0.05
Tasks: 156 total,   1 running, 155 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.6%us,  0.2%sy,  0.0%ni, 99.2%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   8071104k total,  1939640k used,  6131464k free,   326044k buffers
Swap:  8595452k total,        0k used,  8595452k free,   832772k cached

During i7z running, I retried commands as root:

sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
sudo cpupower -c 0-3 monitor

… and the output is like that in my first post.

Perhaps the problem comes from the material or bios? I need to find another openSUSE user with a Core i5 processor.

Hi!

I have a related to this discussion question so I’ll just put it here. I hope it’s OK.

Any overclockers here? I have Intel i7 2600K (sandy bridge) with HT enabled and asrock p67 fatality pro motherboard. Since these processors are really easy to overclock the only notable thing here I’ve done us to set the turbo multiplier to 40 for all cores enabled. It was higher before but I wanted to make sure everything is 100% stable before I install my opensuse. The problem I have is with the turbo frequency not being shown correctly. It maxes at 3.4GHz instead of 4.0GHz. I think in reality the frequency actually goes up to 4.0GHz since that’s the setting in BIOS but is somehow reported wrong by the kernel. The processor is listed everywhere as 3.4GHz one by intel so probably I shouldn’t expect it to show the real frequency but somehow scale it to the range 1600 - 3400. Probably this is the way it’s supposed to be listed but I wanna double check.
The other related thing is even if the CPU isn’t overclocked it’s supposed to turbo at 3.5GHz for all cores and up to 3.8GHz for only one core. So I expected to see 3.5GHz listed as available frequency to be used but it seems that isn’t the case.

Here are the contents of some files as additional info:

/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

3401000 3400000 3200000 3000000 2800000 2600000 2400000 2200000 2000000 1800000 1600000 

/sys/devices/system/cpu/cpu0/cpufreq/bios_limit

3401000

/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

ondemand

“cat /proc/cpuinfo | grep MHz”

cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000

One the good side the idle frequency is the right one in my case -it’s supposed to go as low as 1600MHz.
I haven’t tried i7z or anything else. I know I am overthinking this, but hopefully some other people with the same family of processors will be able to give me some more insight.

Thanks!

On Thu, 01 Dec 2011 09:56:02 +0000, artopage wrote:

> Perhaps the problem comes from the material or bios? I need to find
> another openSUSE user with a Core i5 processor.

You might need to, or you might just need to tax the processor harder to
get it to step up.

If you code at all, a really simple way to do this is to write a short C
program that runs an infinite loop - something like:

— code —
main()
{
while(1);
}
— code —

Note that in my testing, this doesn’t cause any problems other than high
utilization, which is what it’s intended to do. CTRL-C should abort it
just fine. But I haven’t tested extensively so use at your own risk. If
you want to compile it, put the code between the tags in a file called
‘cputhrash.c’ and then run:

gcc -o cputhrash cputhrash.c

Should compile just fine.

Then run with:

…/cputhrash

And have a look at what the CPU does. This is single-threaded, so it
should just drive one core up. You can use htop (probably will have to
install it) to see which core the process is running on.

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

@hendersj: OK I will try today. But my processor has no problem with high frequency. It runs fine at 2.5 GHz when a high frequency is needed.

@ssaatt: Please, can you try the two commands below (when idle):

sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq

uname -r

Here is a screen from i7z:

Cpu speed from cpuinfo 2491.00Mhz
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc
Linux's inbuilt cpu_khz code emulated now
True Frequency (without accounting Turbo) 2491 MHz
  CPU Multiplier 25x || Bus clock frequency (BCLK) 99.64 MHz

Socket [0] - [physical cores=2, logical cores=4, max online cores ever=2]
  TURBO ENABLED on 2 Cores, Hyper Threading ON
  True Frequency 2590.64 MHz (99.64 x [26])
  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  32x/30x/30x/30x
  Current Frequency 3150.95 MHz [99.64 x 31.62] (Max of below)
        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp
        Core 1 [0]:       3150.95 (31.62x)      99.4       0       0       0       0    67
        Core 2 [2]:       2989.20 (30.00x)      8.27      14     2.3       1    72.8    58

Surprise: the real frequency go to 3.1 GHz (available maximum frequency is 2.5 GHz).

Here is a htop screen:
http://thomas.mur.free.fr/tmpcpu/htop.jpg

And here from the Gnome monitor:
http://thomas.mur.free.fr/tmpcpu/cpu-monitor.jpg

Sure I can, but I’m afraid there is nothing interesting about them.


1. Frequency when idle(cpu0):
1600000

2. kernel
2.6.37.6-0.9-desktop

The lowest state for my CPU frequency should be exactly that - 1.6GHz.
I’m actually not surprised at all about your processor turboing too. Pretty much every single one does today. What I found is that the highest listed frequency to be used(the one 1 MHz higher then the supposed “normal” operating speed) actually corresponds to turbo being active. The kernel don’t report that because it’s hardware that’s responsible for what the frequency will be after turbo is active based on some thermal or power constrains. The other utilities that are able to show the correct speed should be doing some tricks(I haven’t tried any of them). The turbo state in my case after overclock is fixed to let’s say 4GHz every time no matter what, but otherwise it’s supposed to be changing based on how many cores are active and how many are idling.

Thank you. So I’m lonely with my idle at 1.8 GHz. :frowning:

On 12/02/2011 05:26 PM, artopage wrote:
>
> Thank you. So I’m lonely with my idle at 1.8 GHz. :frowning:

and, a 900 horsepower blown Corvette engine burns more fuel while idling
at 2000 RPM than does a 250 horsepower normally aspirated Chevrolet
engine of the same displacement idling at 750 RPM…


DD http://tinyurl.com/DD-Hardware
openSUSE®, the “German Engineered Automobiles” of operating systems!

On Fri, 02 Dec 2011 09:06:40 +0000, artopage wrote:

> @hendersj: OK I will try today. But my processor has no problem with
> high frequency. It runs fine at 2.5 GHz when a high frequency is needed.

I expected it would, but wonder if maybe the reason you’re not seeing the
frequency go up to that is that it’s just not being taxed enough when you
check.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C