You are not logged in.

#1 2013-06-06 21:57:42

WolleTD
Member
Registered: 2012-11-13
Posts: 70

How to use intel_pstate?

Ok guys,

I recently set up Arch Linux on my notebook. I saw, that the cpu frequency isn't going down to it's minimum while, according to top, only about 0.5% of the CPU is used.
When I tried to use cpupower to manage this issue, I discovered, the system is using the driver intel_pstate and it seems to be impossible to make frequency adjustments with this.

In addition, sometimes at boot, I see errors by laptop mode tools according to the ondemand governor, which cannot be set.
Can anybody tell me how to get my cpu frequency to be scaled efficiently while having intel_pstate used?

I'm on 2nd-gen i5 system (i5-2410M), according to

cpupower frequency-info

, frequency can be between 800 MHz and 2.9GHz and governor "powersave" is in use.
According to

watch grep \"cpu MHz\" /proc/cpuinfo

, frequency varies between 1GHz and 2.2GHz on all 4 cores, Only the first one goes below 1GHz from time to time.

Thank you,
Wolle

Offline

#2 2013-06-06 23:00:10

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: How to use intel_pstate?

The frequency is an indicator, but the new driver makes the cpu idle in a different way. Have a read at the info in this thread

Offline

#3 2013-06-07 02:28:34

Svenstaro
Administrator
From: Germany
Registered: 2008-11-19
Posts: 388

Re: How to use intel_pstate?

The goal of the pstate driver is not to keep your cpu st the lowest possible frequency at all times. Intel engineers figured out that the frequency doesn't actually help the power that much. Probably pstate is working as intended.

Offline

#4 2013-06-07 02:34:23

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: How to use intel_pstate?

Svenstaro wrote:

The goal of the pstate driver is not to keep your cpu st the lowest possible frequency at all times. Intel engineers figured out that the frequency doesn't actually help the power that much. Probably pstate is working as intended.

Yes, it is not about what frequency your processor is at, but rather how often it is able to reach the deepest of sleep states.  This will have a much much greater effect on power savings than simply trottling the frequency all the time.  In fact, it apparently can be bad to have ondemand as it makes it so that it has to jump back to the highest frequency, which can take a fraction of a second.  But that fracion of a second is spent not being in a "race to idle" situtation.

Disable cpupower.service, and leave it set at powersave.  I have found that performance vs powersave makes little if any difference.  What I would recommend though is trying out thermald (Intel's Linux Thermal Daemon), which uses the intel specific features found in the kernel to regulate thermal levels efficiently with minimal performance loss.

Offline

#5 2013-06-07 06:44:53

MilenKid
Member
Registered: 2013-04-21
Posts: 86

Re: How to use intel_pstate?

thermald from AUR is out-of-date. You have to compile it yourself from upstream for updates (It's no big deal).

Last edited by MilenKid (2013-06-07 06:45:33)

Offline

#6 2013-06-07 13:10:55

WolleTD
Member
Registered: 2012-11-13
Posts: 70

Re: How to use intel_pstate?

Okay, I built and installed thermald, enabled the service... After some minutes doing usual stuff, there are several thermald instances with 7-99% CPU usage each and I could dry my hair using the fan... What happened? Unfortunately, I didn't find some useful manual about thermald...

Edit: I checked journalctl and figured out I forgot to load the MSR module and got a whole bunch of errors. After loading MSR, it looks like it's working but the notebook keeps being pretty warm and the fan keeps blowing... I will let it cool down completely and then check again...

Last edited by WolleTD (2013-06-07 13:40:18)

Offline

#7 2013-06-07 15:06:06

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: How to use intel_pstate?

It is a git package and ever out of date. There is just no maintainer, so it was flagged out of date because a few changes needed to be made to the pkgbuild.  Read the comments, I posted an updated pkgbuild there that I have been using.  It works fine.

Offline

#8 2013-06-07 16:01:16

WolleTD
Member
Registered: 2012-11-13
Posts: 70

Re: How to use intel_pstate?

I saw and used that...
Okay, after letting the system cooling down, the fan was activated less than 5 minutes after startup. When I had Windows running on the notebook (Dell XPS 15) it took half an hour to start at minimum. Why is this?

Offline

#9 2013-06-07 16:27:13

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: How to use intel_pstate?

Since the intel_pstate driver and the Linux Thermal Daemon is still so new, it is apparently not without some bugs.  Some users report higher temps after suspend for example, and some report higher temps in general.  Thoeretically, the Linux Thermal Daemon is supposed to use the pstate driver, the RAPL driver, the powerclamp driver, and the tstate driver, in that order to keep the system cool.  If after utilizing all those things, the system is still getting hot and reaches a certain threshold, it will then employ the fans to get the system thermally under control.

On my system, it works amazingly.  I rarely have the fans ever going, and I rarely have high temps.  I have a dual-core i5 3210M, which is an Ivy Bridge, but I modified the kernel source to make the intel_pstate driver apply to my generation of processor.  At the moment, my temps (from lm_sensors) is right at about 40C.  Typically this is about where they stay, though sometimes if I am just reading email or responding to these threads, it can go into the low 30's.  The highest I usually see it is <60C, and still the fans typically do not kick in at that point either.

If the thermald service is not working well for you, you might want to see about what happens is you simply use the system as is, and see if your bios can effectively cool your processor with its own fan control.  Before I started using the thermald and intel_pstate, I was pretty stongly of the opinion that using fan control daemons were probably of more harm than benefit, unless your firmware was particularly bad at its job (which is a very real possibility).  What really struck me as odd is that Thinkpad's have more software devoted to their fan control than seemingly any other brand out there, yet the Thinkpad firmware is pretty solid most of the time.  I did at one point set up a thinkpad fan thing (I can't remember what I used) just to see, and found that it did little but kick on my fans more than they were needed. 

So stop using the thermald and see how things go.  The inte_pstate on its own should be pretty effective in handling your system's power consumption and therefore thermal levels.  That is of course, unless you are one of hte unfortunate sufferers of the pstate bugs.  If that is the case, and you can't figure out any way of effectively using the pstate driver, you can disable it from the kernel command line.

Offline

#10 2013-06-07 17:00:37

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: How to use intel_pstate?

Apart from above, also comment out laptop mode tools cpu governance stuff so that it won't collide with the rest. I had a similar "hair dryer" problem (using a powersave setting). Setting "performance"  in /etc/default/cpupower and disabling other interfering AUR helpers for the cpu turned out pretty effective here with just the pstate.

Offline

#11 2013-06-07 20:43:50

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: How to use intel_pstate?

@Strike0, your new avatar threw me off a bit.  Nice.  What other kinds of "AUR helpers for the cpu" were you using?  I find it interesting that setting performance seemed to help.  I did notice that cpupower.service still worked fine as long as you had either "performance" or "powersave" as the governor setting.  I just saw no reason to change it on my particular macine.  People who have cpupower.service failing is just because they are trying to use a governor that no longer exists I suppose.  But when I looked at the output of "cpupower frequency-info" and saw that "available cpufreq governors: performance, powersave" it was pretty clear to me that using "ondemand" was not an option...

Offline

#12 2013-06-07 23:40:10

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: How to use intel_pstate?

@WonderWoofy: Yeah, actually I the machine here was running into troubles with the "powersave" also though. I had never used performance on it, because the battery is not the thickest pack. But as I wrote that now works great. When I wrote above earlier powertop was reporting <10watts with full brightness & wifi. That is like in 'pre-regression' times, but with performance.. yet it is not 100% consistent after each resume (can be ~13 watts too), I have not figured out what makes the difference in these instances.
I use tlp for the other options.
Thanks for the avatar. Credits for that actually go to Paul Klee. I was browsing his art and that one somehow stroke me as having a bit of Arch in it. He painted it in 1923.

Offline

#13 2013-06-10 15:02:53

WolleTD
Member
Registered: 2012-11-13
Posts: 70

Re: How to use intel_pstate?

Okay, sorry for the late reply...
I tested performance and powersafe and don't see any differences according to power consumption...

What I've done so far:
- cpupower running with performance governor
- leaving intel_pstate driver
- installing and enabling thermald, did nothing with it

So, what to do now?

Offline

#14 2013-06-10 15:54:21

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: How to use intel_pstate?

Okay... so is your power consumption considerably worse than it was using ondemand?  It shouldn't be.  Though I also don't think that with the change to the intel_pstate driver you are going to suddently see 12.492 more hourse of battery life either.  I think that it really will result in a slight improvment in battery life/power consumption, but where it really improves the situation is in its overall efficiency of how the processor is handled in general.  One of the problems that was pointed out with ondemand and new intel processors is that the acpi_cpufreq module would cause the processor to sit at the lowest frequency most of the time.  Then when more processing power was needed, it would have to change the clock speed, which occurred in userspace.  So it would end up sitting in the lowest freq for longer than totally necessary, which according to the "race to halt" idea, means that there is just that much more time that is spent being less efficient.  But of course frequency changes happen so quickly that this change will probably not be noticed in your day to day computing.

So unless you are seeing significant power regressions, I would say just choose powersave or performance and let it do its thing.  It has been quite some time since the "conservative" and acpi_cpufreq's "powersave" (lowest freq always) has been determined to be worthless for newer processors.  So really, with the old system and cpupower, you should have been only choosing between ondemand or performance anyway. I think if you are only seeing slight regressions that can be tollerated, then just keep using it and wait for the bugs to get ironed out.  But if you are seeing regressions whatsoever, you should be reporting bugs.

If you want to use "performance" with the intel_pstate driver, you still need to use cpupower.service to set this on boot.  Otherwise, "powersave" is the default, so if this is what you want, just disable cpupower.

Offline

#15 2013-06-10 16:29:41

WolleTD
Member
Registered: 2012-11-13
Posts: 70

Re: How to use intel_pstate?

Nevermind guys,

I just realized that I was so fixed on the pstates, I forgot about bumblebee so both graphics cards in the notebook were running... Now everything seems to be okay...
While powertop still says both cards are running at 100%, the power consumption of the system is significantly lower than before starting bumblebee...

Offline

Board footer

Powered by FluxBB