Possible Power Management regressions in recent Linux kernels ?

There are tidbits elsewhere in our forum on this possible Power Management regression topic, so I thought I would start a thread in ‘chat-chat’ on this, to consolidate the information. This is NOT a help request thread, and if one wants help, then this thread is NOT the place.

There have been a series of articles on the Phoronix web site, which have suggested regressions in the Linux kernel

  • during the 2.6.37 to 2.6.38 and
  • during the 2.6.34 to 2.6.35

with the 2.6.34 to 2.6.35 being discovered last.

Some quotes from the Phoronix web site posts …

FIRST, the 2.6.37 to 2.6.28 possible regression was discovered: [Phoronix] Mobile Users Beware: Linux Has Major Power Regression](http://www.phoronix.com/scan.php?page=article&item=linux_mobile_uffda&num=1) where they state:

During the Linux 2.6.38 kernel development, a regression was introduced causing systems to burn through significantly more power. … On the particular system being talked about in the article today is the power consumption going up by 14%, which would lead to a noticeably shorter battery life. … The Linux 2.6.35/2.6.36/2.6.37 results are virtually identical, but with 2.6.38 is where the regression strikes. As far as the Linux 2.6.39 results, it shows the regression still present. …
SECOND, the 2.6.34 to 2.6.35 possible regression, discovered [Phoronix] Another Major Linux Power Regression Spotted](http://www.phoronix.com/scan.php?page=article&item=linux_kernel_regress2&num=1) after Phoronix upgraded their benchmarks and paid more attention to power management in the results. Also, the 2.6.34 to 2.6.35 possible regression appeared worse than the 2.6.37 to 2.6.38.

With this expanded round of power testing, the Linux 2.6.37 to Linux 2.6.38 regression is still shown, but it also uncovered a very noticeable differentiation in power consumption between the Linux 2.6.34 and 2.6.35 kernels too. Under idle on this test system, it equates to a 20% difference in power consumption and then the 2.6.37/2.6.38 regression tacks on another 6% in this particular test profile.

… The pre-2.6.35 kernels are all running at right around the same power level within a reasonable milliwatt range of each other on the various tests. … However, with the Linux 2.6.35 kernel, the power consumption goes up noticeably.

Now the above is all from Phoronix. I can not recall other blogs or Linux articles posting about this with independent confirmation, although I do recall some openSUSE-11.4 users complaining about their battery laptop life. Unfortunately I can’t find those threads to see if what they observed ‘might’ fall into this possible kernel regression category.

Have any openSUSE-11.4 (2.6.37 kernel) or Tumbleweed-11.4 (2.6.38 kernel) users noted this decrease in battery life on their laptops with those Linux versions ?

Note this is not a thread for complaints / rants. I have moderator permissions and I will delete any rants that might follow this post. I prefer simple observations, not negative insulting judgments about what ‘may’ have happened wrt power management. Thank you.

I have an older laptop (purchased 2004). The power consumption seems to have gone down on that.

I am mostly going on fan noise. It is usually a quiet whisper with WinXP, though it got noisy at times, particularly when the anti-virus was updating. With opensuse 11.3, it was very noisy all of the time. Now, with 11.4 it is closer to the Windows noise level. I suspect that the difference is mainly with the video driver, but that’s admittedly a guess.

On a newer laptop, I didn’t use 11.3 long enough to have paid attention. With Windows the fan is mostly off, but kicks in occasionally. With 11.4 the fan is on all the time, though at a low level - it speeds up when doing updates. I am having video problems (freezes), so running with “nomodeset”. I tested running without “nomodeset” and the fan seemed to be off most of the time.

I wonder if it is possible to determine just why the power consumption is higher? I found at least one link on controlling power consumption here:

How to reduce power consumption - ThinkWiki

It seems that besides what ever the kernel is doing, the Desktop selected has some effect. For instance, has anyone played with the YaST module yast2-power-management? It KDE, it seems the ability to control the CPU speed has been removed though the default is supposed to be energy savings mode of some sort. The CPU is the number one power user, followed by Video and hard drive. On a laptop, almost all devices can be turned off when not needed and it has to be a failure to turn off unneeded devices or overriding normal BIOS settings when the kernel loads that can increase power usage. Most of the time, power consumption is not a concern of mine, except while at work. I very often find myself working with my computer, loading and trouble shooting software by the light of my LCD screen and no outlet that works in sight (New Construction sites). If your power consumption is down by 20%, that can mean the difference between making it all day or even making to lunch before you have to find an outlet and recharge. So power consumption while at work means a great deal to me and perhaps you are in the same boat as I.

Thank You,

I have tested it with my Sony Vaio Laptop, running the 2.6.37 Kernel in openSUSE 11.4, alongside with the normal Intel Graphics driver.

I did not feel so much difference to the old Kernel, which was replaced recently. The battery makes nearly 2h 30 minutes, as before.

I have rather agressive power settings in KDE, to save as much as possible, when running on battery. This means dimming the display when ever possible, running the most possible lowest backlight setting… and so on.

But I also want to play a bit with yast2-power-management and see what comes out with that.

But I also want to play a bit with yast2-power-management and see what comes out with that.
This just gives you the ability to set what profile the CPU speed is using. Once you load this yast power program, you need to restart yast and go into Run Level and enable the service pm-profiler, then the yast power management function will work.

Thank You,

does it somehow overwrite the KDE powersettings or sets it the CPU speed additionally to the KDE powersetting (slightly off topic… sorry for that)

thanks!

does it somehow overwrite the KDE powersettings or sets it the CPU speed additionally to the KDE powersetting (slightly off topic… sorry for that)

thanks!
As I understand it, KDE no longer makes any adjustments to your CPU speed in its power settings. I presume the mode your CPU is in was set by a kernel default which yast2-power-management allows you to adjust in a crude way.

Thank You,

Its interesting that Phoronix are now suggesting that laptop users with newer kernels (2.6.27 and newer to present) consider adding the boot code:


pcie_aspm=force

to work around some of the power management issues.

The Phoronix article is here: [Phoronix] The Leading Cause Of The Recent Linux Kernel Power Problems](http://www.phoronix.com/scan.php?page=article&item=linux_2638_aspm&num=1)

Phoronix believe the biggest cause of the 2.6.38 power issue (according to their testing software and the hardware they have been running) is due to a change in behavior regarding ASPM. ASPM is the Active-State Power Management for PCI Express. Namely, they claime to blame is commit 2f671e2dbff6eb5ef4e2600adbec550c13b8fe72 that is titled “PCI: Disable ASPM if BIOS asks us to.

Read more on the article to see the details.

Wrt the work around, they say this:

Given the thousands of users having this 2.6.38 power regression by this change, there is a big ASPM problem at hand. Fortunately, as PCI-E ASPM problems are not new, a few boot options can be used. Namely, most people affected by this issue will want to add “pcie_aspm=force” to their boot command line. Simply adding this will force Active-State Power Management to be enabled.

So this is a real big story oldcpu. If you have not already done so, you might want to blog about this setting: **pcie_aspm=force **which you would add to your kernel load options in the grub menu.list file. It is interesting to note that this one change can reduce power usage up to 15% on kernel 2.6.38, even better before the regression was noticed. It is also interesting to see that yet other power regressions are actively being sought as in the following quote:

Again, this is not the only major power regression outstanding. There is still a noticeable power regression back in the Linux 2.6.35 kernel, another 2.6.38-era regression due to a scheduler issue still being investigated, and some other items on my radar. A number of other Linux power article tests are imminent on Phoronix and I also continue to tweet findings via @MichaelLarabel](http://www.twitter.com/MichaelLarabel) and @Phoronix](http://www.twitter.com/Phoronix).

This is great information. Thanks for sharing it with us oldcpu!

Thank You,

I’ll be sure to test this although my laptop usually survives abot 4 hours on battery when using it so I wouldn’t say I have some power management problems (and it was this way on openSUSE 11.2 and 11.3). The time is also very similar when using win7 but maybe with this boot parameter it will be running even longer :slight_smile:

Best regards,
Greg

Thats a good idea - but I’m heading off on business in less than a couple of hours for 3 days and will only have minimal forum access (or no access0 while away on business.

jdmcdaniel3, if you take the topic and make your own blog post on it, then thats also fine by me. I likely won’t be able to look at this again until the weekend.

Hi

This is not a grouse but an observation. It may relate to this topic

All the latest packages are installed via zypper dup

Over the past month I’ve seeing a significant increase in CPU usage when a usb
memory devise is plugged in.
It is even worse when the usb memory is unplugged.

Immediately the usb memory is unplugged all CPU’s (*4) go to max. frequency.(3GHz)
Some times this lasts for only 20-30 seconds but its not unusual for this
condition to remain until a reboot is executed, > 10 minutes

The offending process is udevd. If this is manually killed normal CPU operation
is instant but a reboot is necessary to restore usb memory usage. Printing via
usb, mouse, kbd operation is not effected.

Regards
michael

Sys Info:-
AMD Phenom™ II X4 940 Processor 4GB ram (800-3000 MHz)
OS: Linux 2.6.39.2-34.1-desktop x86_64
Current user: michael@linux-qz4c
System: openSUSE 11.4-1.9 (x86_64) (Tumbleweed)
KDE: 4.6.4 (4.6.4) “release 5.1”

But my CPU does scale up and down according to demand and I don’t use yast2-power-management
You can see that in sysinfo:

But my CPU does scale up and down according to demand and I don’t use yast2-power-management
You can see that in sysinfo:

Again, I feel that is due to the kernel default for the CPU speed. Like lots of things, the basis for power control is in the kernel and programs like YaST Power Management and even the Firewall are just controlling the built-in kernel functions. Further, at least with KDE, these functions of CPU speed control were moved. You can also control the CPU speed with the CPU Frequency Utilities.

Thank You,

IMHO you are better off starting your own thread.

I don’t think cpu usage is relevant to power management regressions that I thought I laid out pretty clear in my first post.

Instead it just takes the thread off topic.

Thanks for the suggestion: I created a blog entry here: GNU/Linux and openSUSE power management regressions - Blogs - openSUSE Forums

I did not mention the menu.lst point … as that was your suggestion :slight_smile: Feel free to add that, or even create your own blog entry reference that aspect :slight_smile: as that is useful for user’s to know, not only for power management but for ANY boot code they wish to have continually applied.

… I also added a few more interesting tidbits, such as Ubuntu (and hence possibly openSUSE) being similar to Windows7 for power management, and the proprietary AMD Catalyst graphic driver being superior for power management (in addition to being superior for performance) to the open source Radeon driver.

Here are my observations based on battery time left reported by KDE.

Here are the screenshots I’ve made.
Dropbox - Photos - Simplify your life

What I did was :

  1. fully charge the battery and unplug the power supply
  2. make some screenshots with the kernel boot parameter
  3. disable the boot parameter
  4. reboot
  5. do some more screenshots
  6. enable the boot paremeter
  7. reboot
  8. make some screenshots and so on

What I’ve learned is that the battery time left reported by the KDE is totally unreliable but anyway appending this boot parameter does seem to extend the battery life but it’s impossible to tell how much based on this test only.

Best regards,
Greg

Indeed it does, cpufreq is built into the kernel and uses the governor ondemand by default, the package cpufrequtils gives you the choice of several governors.

Linux Kernel Documentation :: cpu-freq : governors.txt

An LWN article discussing this topic :
PCIe, power management, and problematic BIOSes [LWN.net]

Best regards,
Greg

I switched from 11.2 to 11.4 and immediately noticed a change with the 2.6.37 kernel:

The fan of my Thinkpad T61 was hardly noticable before and is now running on 3000 rpm in idle state,
while the temperature is stabilizing on about 60C.
It has never been as hot as this. (I started with opensuse 10.3 in 2008)
While running on battery, the power rating measured by the charge-controller is about 20 Watts
(machine idle, disk, display and backlight active).

For other kernel-related problems I changed to a vanilla 2.6.39, which apparently
didn’t fix the thermal problems.
I added the ASPM flags, which is an improvement. In battery mode I’m back to about 15Watts.

But this is still not as good, as it used to be before.

Is there any exact bisection or workaround of the issues in 2.6.34-2.6.35?