You are not logged in.

#1 2013-09-06 22:07:35

A.J.Rouvoet
Member
From: Naaldwijk, The Netherlands
Registered: 2012-06-30
Posts: 37
Website

CPU Frequency scaling 4500U haswell

I have an issue with frequency scaling on the 4th gen 4500U intel processor in my Sony Vaio Pro.
Using the simple patch mentioned in this blog: http://elouisyoung.blogspot.nl/2013/07/ … -with.html
the CPU correctly functions at 1.8Ghz per default (according to `cat /proc/cpuinfo) and scales up on heavy duty work upito the 3.0Ghz turbo frequency.
Howerver, once the heavy jobs are done, the CPU won't scale back to 1.8 (or lower, as should actually be possible); /proc/cpuinfo will still report 2.8Ghz for all cores.

Anyone suggestions to a possible diagnosis or solution?

Offline

#2 2013-10-06 05:16:38

d4l3k
Member
Registered: 2013-10-06
Posts: 2

Re: CPU Frequency scaling 4500U haswell

I've been having this same issue, and rebooting temporarily fixes the issue.

Offline

#3 2013-10-06 05:40:18

Pse
Member
Registered: 2008-03-15
Posts: 413

Re: CPU Frequency scaling 4500U haswell

What happens if you disable p-state and use the ondemand governor as temporary solution?

Offline

#4 2013-10-06 09:57:28

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: CPU Frequency scaling 4500U haswell

Doesn't matter what cpuinfo reports, the CPU will be in the c7 state most of the time anyway, where the frequency is 0. Freq scaling is basically an outdated concept on modern Intel CPUs.

Offline

#5 2013-10-06 17:14:35

Pse
Member
Registered: 2008-03-15
Posts: 413

Re: CPU Frequency scaling 4500U haswell

Gusar wrote:

Doesn't matter what cpuinfo reports, the CPU will be in the c7 state most of the time anyway, where the frequency is 0. Freq scaling is basically an outdated concept on modern Intel CPUs.

Ah, Gusar is right. Use powertop or i7z to check p-states.

Offline

#6 2013-10-07 12:04:21

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: CPU Frequency scaling 4500U haswell

Look here: https://plus.google.com/114657443111661 … Ln9T4ehywL

Today, things are much more complex in several key ways.

First of all, and this is important and different from 10 years ago... no matter which P state you ask for, when a logical processor is idle (C state), its frequency is typically 0. The exception to this "typically" is the lightest of the C states (C1), where the frequency is the lowest frequency the CPU supports, and not zero. (but going into C1 is pretty rare, and very short lived, so for this posting, I'm going to ignore C1).

A second important aspect is that of "coordination". For practical reasons, on current Intel processors, all the cores in a package share the same voltage. And because running at a lower frequency than possible at a certain voltage is inefficient, all the cores will also share the same clock frequency at any one time. Of course, except the cores that are idle, because their frequency is zero!

I think this means that on a Haswell CPU, scaling down is unnecessary, since simply switching to C0 makes your CPU save as much power as it possibly can.

Offline

#7 2013-10-07 12:45:42

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: CPU Frequency scaling 4500U haswell

brain0 wrote:

since simply switching to C0 makes your CPU save as much power as it possibly can.

Actually, C0 is the state with the most power consumption smile. It's the active state, where the processor is actually doing stuff. Then you have the idle states, C1-C7, the higher (or deeper, as is the usual terminology here) you go, the less power consumption there is. Haswell will spend most of the idle time in C7, a bit in C1, others pretty much aren't used. The turbostat tool, part of the kernel source, is very useful for tracking C states.

Offline

#8 2013-11-23 12:33:45

bio
Member
Registered: 2013-11-22
Posts: 8

Re: CPU Frequency scaling 4500U haswell

Hi,
is there any update on this?
Is there any bug number in kernel?
I have Lenovo T440s with Haswell, same issue.
Thanks.

Offline

#9 2013-11-29 16:08:30

LimaSierra
Member
Registered: 2011-04-26
Posts: 41

Re: CPU Frequency scaling 4500U haswell

bio: If I understand this correctly, this is not an issue.

I tried setting the max. frequency with cpupower and monitored the power consumption for a while, using powertop.
Well, at least for me, there is no noticeable difference. And both cores stay in C7 around 90% of the time as I am writing this, so I guess everything is working smile

Offline

#10 2013-11-29 17:00:33

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: CPU Frequency scaling 4500U haswell

Not an issue... use the i7z-git package from the AUR for haswell processors.  My brand new 4130T never scales the frequency down, but stays in C7 state most of the time.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#11 2013-12-04 08:30:09

bio
Member
Registered: 2013-11-22
Posts: 8

Re: CPU Frequency scaling 4500U haswell

It's an issue.
there is higher power consumption.

Offline

#12 2013-12-04 09:47:44

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: CPU Frequency scaling 4500U haswell

bio wrote:

It's an issue.
there is higher power consumption.

Open an upstream bug report.

EDIT:  https://bugzilla.kernel.org/show_bug.cgi?id=93521#c10

Last edited by graysky (2015-03-14 11:48:02)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#13 2013-12-04 10:27:09

bio
Member
Registered: 2013-11-22
Posts: 8

Re: CPU Frequency scaling 4500U haswell

graysky wrote:
bio wrote:

It's an issue.
there is higher power consumption.

Open an upstream bug report.

already opened:
https://bugzilla.kernel.org/show_bug.cgi?id=65301
https://bugzilla.kernel.org/show_bug.cgi?id=65591

Offline

#14 2013-12-04 11:03:46

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: CPU Frequency scaling 4500U haswell

Those bugs are about different things. The first one is about an issue after suspend.

In the second one, the person isn't getting as much deep C-states, but that's not necessarily a pstate bug, but something else on his machine, his DE doing lots of stuff or something else hogging the CPU. For example, compare his figures to mine.

From the bug:

cor CPU    %c0  GHz  TSC SMI    %c1    %c3    %c6    %c7 CTMP PTMP   %pc2   %pc3   %pc6   %pc7   %pc8   %pc9  %pc10  Pkg_W  Cor_W GFX_W
          5.40 0.80 2.30   0  14.95   2.12   0.34  77.19   41   42  10.70   0.00   0.00   0.00   0.00   0.00   0.00   4.04   0.21  0.22
  0   0   7.04 0.80 2.30   0  12.98   2.00   0.20  77.78   41   42  10.70   0.00   0.00   0.00   0.00   0.00   0.00   4.04   0.21  0.22
  0   1   4.29 0.80 2.30   0  15.73
  1   2   6.16 0.80 2.30   0  14.52   2.24   0.49  76.60   40
  1   3   4.12 0.80 2.30   0  16.55

My machine:

cor CPU    %c0  GHz  TSC SMI    %c1    %c3    %c6    %c7 CTMP PTMP   %pc2   %pc3   %pc6   %pc7  Pkg_W  Cor_W GFX_W
          0.09 3.55 2.89   0   1.00   4.44   0.02  94.45   28   30  96.11   0.00   0.00   0.00   7.65   0.17  0.00
  0   0   0.08 3.55 2.89   0   3.07  17.76   0.00  79.09   28   30  96.11   0.00   0.00   0.00   7.65   0.17  0.00
  1   1   0.06 3.53 2.89   0   0.54   0.00   0.00  99.40   25
  2   2   0.11 3.55 2.89   0   0.32   0.00   0.06  99.51   24
  3   3   0.12 3.57 2.89   0   0.07   0.00   0.00  99.81   28

In contrast to that bug, I get very little C0 and a lot of C7.

But what this thread is about is how frequency scaling differs between ondemand and pstate. Ondemand was doing unnecessary work, it's not needed to scale the freq all the time, because it's the C-states that power saving comes from. So the "my CPU is always at max freq" thing is indeed not an issue. The CPU is *not* at the max freq all the time, it's only at the shown freq in the C0 state. And on a working system, the C0 state will be used less than 1% of the time.

Last edited by Gusar (2013-12-04 11:12:03)

Offline

#15 2013-12-04 18:06:49

bio
Member
Registered: 2013-11-22
Posts: 8

Re: CPU Frequency scaling 4500U haswell

Ok. So i was wrong about the cause.

Offline

#16 2014-01-13 22:06:53

king.flasher.dave
Member
From: Berlin
Registered: 2008-11-25
Posts: 140
Website

Re: CPU Frequency scaling 4500U haswell

@bio: does installing and activating tlp help?
It helped with my t440p (down to 17W on battery, from 45W). A lot of C7 state now smile


Speak when you are angry and you will make the best speech you'll ever regret.

Offline

#17 2014-01-13 22:11:50

LimaSierra
Member
Registered: 2011-04-26
Posts: 41

Re: CPU Frequency scaling 4500U haswell

Still 17W? I have 10, without tlp.
And 70 - 80% C7 state.

Offline

#18 2014-01-14 09:46:11

king.flasher.dave
Member
From: Berlin
Registered: 2008-11-25
Posts: 140
Website

Re: CPU Frequency scaling 4500U haswell

Well, had some processes running then wink
It's now down to 15W with wifi on and firefox running.


Speak when you are angry and you will make the best speech you'll ever regret.

Offline

Board footer

Powered by FluxBB