This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

Intel and PowerTOP extend Linux laptop battery life

By Mayank Sharma on May 17, 2007 (8:00:00 AM)

Share    Print    Comments   

Intel recently released its PowerTOP utility, which builds on work done by kernel developers to make the Linux kernel power-efficient. PowerTOP gives you a snapshot of what apps are consuming the most power. Turn off these apps or modify their behavior, and you'll notice an instant increase in the battery life.

When announcing the PowerTOP utility on the Linux kernel mailing list last week, Intel's Arjan van de Ven said that the tickless-idle feature in the latest 2.6.21 kernel helps save a lot of power by allowing the processor to be idle for long periods of time, instead of waking up every millisecond for the timer tick.

But there's more to a Linux distribution than the kernel; applications may also have tunables to help save power. How do you see which apps are hogging the processor and consuming power? The top utility gives the percentage of CPU and memory individual processes are taking, but that doesn't help much, since there's no power-related information there. That's where PowerTOP comes in.

Installing and using PowerTOP

PowerTOP needs the tickless idle (CONFIG_NO_HZ) parameter enabled in the kernel for best performance. This parameter is only in kernels 2.6.21 and above. It also needs the CONFIG_TIMER_STATS option enabled in the kernel in order to give you detailed statistics. Since most distributions have a custom kernel and maintain a development branch, grabbing a kernel using the appropriate repositories should be enough. I successfully run PowerTOP on Fedora Core 7 Test 4, which reports the kernel to be 2.6.20.

PowerTOP is already in the repositories of several distributions, but it's also easy to install from source. In fact, I suggest installing from source, since the app is under heavy development and new improved versions could take some time to creep into repositories.

Interview: Arjan van de Ven
To get details about the PowerTOP project and find out about its future, I emailed a few questions to project leader Arjan van de Ven of Intel.

NewsForge: Could you give us a little background on the project?

Arjan van de Ven: Power consumption of computers is a hot topic right now, be it servers for data centers or laptops for the mobile workforce. The tickless idle functionality as added by Thomas Gleixner and Ingo Molnar is a significant step forward in this regard on the Linux kernel side.

However, when measuring this new feature, we saw disappointing results: while the kernel wouldn't wake up every millisecond, user space would just do this instead. These frequent wake-ups prevented the OS from using all the advanced energy-saving features our hardware experts added to Intel's products, and it reduced the battery life of my own Linux laptop ... so there was some personal incentive for me to work on this as well.

NF: What are the objectives of the project? I see it divided between the PowerTOP utility and making application patches to save power.

AV: The primary objective is getting Linux to use less power, to have Linux make maximum use of the power-saving features within your computer. Intel can't do this alone; we want and need to cooperate with the wider Linux community. Providing fixes and patches for features is one thing, and we do that and have been doing that for a long time. With PowerTOP, we provide a tool that enables developers to quickly see issues on their own setups and to fix them. We will continue to use the tool ourselves, and that's where most of the patches to the other projects came from.

NF: Are you looking for community participation? What are the areas where users can contribute?

AV: Absolutely. This is already happening on the IRC channel (#powertop on irc.oftc.net); there usually are between 30 and 50 people exchanging ideas, patches for fixing issues, and bug reports to PowerTOP. Several of these active folks are also contributing patches to PowerTOP to fix bugs in it. Developers are contributing patches to fix issues found in various open source projects, end users are reporting things they see on their machines and are exchanging tunables they found. If there's good ideas that work well, we put them on the Web site for others to use on their systems.

In addition, I'm hoping (and we're seeing that happen already with the KDE and GNOME projects) that the various open source projects start using PowerTOP to check and fix their own software.

NF: As of now, the project doesn't have much documentation. There's a mailing list and an IRC channel -- any forums/wiki/static HTML documentation in the pipeline?

AV: We're constantly updating the Web site with suggestions and tips and tricks from users and with answers to questions people ask us on IRC or on the mailing list. We're working on a page aimed at developers of open source projects on how to diagnose sightings and ideas for how to code certain constructs in their applications that we see as common pattern.

The entire documentation on the Web site is a "write as we go" environment, with most of the input and suggestions coming from the IRC channel and the mailing list.

NF: From what I can gather, a 64-bit version of PowerTOP is in the pipeline. What more can we expect? More patches?

AV: PowerTOP already works on 64-bit, it's just the tickless kernel feature that isn't merged yet into the mainline kernel (there's a patch on lkml though). To get any real power savings, this tickless feature is needed. But to find software issues, you can do that on 64-bit today.

Going forward, the biggest outstanding feature request we have for PowerTOP is for it to show which applications keep the disk busy. Another enhancement we'll be looking at is increasing the number of "live" suggestions PowerTOP makes while running, and possibly even "press the <X> key to activate this suggestion now" functionality.

Download the latest PowerTOP tarball (version 1.2 at the time of writing), and uncompress it with tar zxvf powertop-1.2.tar.gz. Change into the directory and compile the utility with the make command. Once it's done compiling, change to the root user and execute the utility with ./powertop. It will gather information about the system for five seconds before launching.

The PowerTOP screen will vary slightly depending on whether you are running it on a desktop or a laptop. Laptop users will get the C-STATE information at the top. As per PowerTOP's Web site, "C-states are operating modes of the CPU when it's idle. The higher the C-state number, the less power is used by the CPU; however, the longer it will take to get the CPU back to executing instructions." This information is followed by the number of wakeups per second. The lower this number, the better.

Power usage is shown only when the laptop is running on battery. PowerTOP uses ACPI to display how much power the laptop is currently using and to calculate the hours of battery life remaining. This information is followed by the top 10 activities that are keeping the machine from sleeping. These could be hardware interrupts or applications. Depending on the activities, PowerTOP prints suggestions at the bottom. You'll notice increased battery life by following these suggestions.

In the images, you can clearly see how the number of wakeups dropped from 156.8 to 142.7 after I disabled Beagle as suggested by PowerTOP. After Beagle is disabled, PowerTOP suggests enabling the CONFIG_USB_SUSPEND option in the kernel, which will automatically disable UHCI USB interrupts, saving 1 watt of power.

Making applications power efficient

PowerTOP is just one part of a bigger power-saving project by Intel. The project Web site also hosts patches for several Linux apps and the kernel. Since there are certain apps we can't or don't want to close or disable, we can use the patches to tweak their behavior and reduce power consumption.

Thumbnail Lose the pup
Click to enlarge
Beside the patch for the kernel, the project is currently hosting patches for the Firefox Web browser, Pidgin IM, Evolution mail client, and others. To use these patches you'll need to compile the apps from source; patches can't be applied to apps already installed by your distribution.

Thumbnail Beagle Gone
Click to enlarge
If you want to patch Firefox, download the source tarball and uncompress it with bunzip2 firefox-2.0.0.3-source.tar.bz2, then untar with tar xvf firefox-2.0.0.3-source.tar. Then download Mike's Hommey Firefox patch and place it in the uncompressed Firefox's source directory. To test the patch, run patch --dry-run -p0 -i firefox.patch. This will test the changes without actually making them. Once it's successful, apply the patch without the --dry-run option -- patch -p0 -i firefox.patch. Once the patch is applied, continue with the ./configure, make, make install process to compile Firefox.

Applying a patch is a little complicated if you are not used to installing apps from source. But if you can wait, the patches will surely make their way into the apps. In fact, the development version of Pidgin already has a patch equivalent to the one on the PowerTOP Web site.

PowerTOP is part of a bigger project to help people reduce power usage and get the most out of their laptop battery. Monitoring consumption is just one aspect of saving power. Tweaking application behavior is where the rubber hits the road. By providing patches to various applications, PowerTOP developers ensure the apps aren't draining the battery by keeping the processor bus needlessly. Since applying patches isn't an easy trick to learn for a desktop Linux user, the developers are looking to work with application developers to tweak and incorporate patches into the app itself. PowerTOP itself is under heavy development and the developers have a list of features to implement, including one to activate PowerTOP's suggestions at the press of button.

Share    Print    Comments   

Comments

on Intel and PowerTOP extend Linux laptop battery life

Note: Comments are owned by the poster. We are not responsible for their content.

Thanks Intel

Posted by: Anonymous Coward on May 19, 2007 06:08 AM
Thanks Intel!

I think that it is an interesting piece of software.

$intel++;<nobr> <wbr></nobr>// 3

#

CONFIG_TIMER_STATS option is under kernel hacking

Posted by: Anonymous Coward on May 20, 2007 12:00 AM
The author should have made this explicit. I was searching for this for a day before I found it.

#

Excellent project!

Posted by: Anonymous Coward on May 21, 2007 04:06 PM
Thanks for this. Much needed, now that laptops and low-power cpu's are becoming popular.
And well implemented, it seems.

#

Intel and PowerTOP extend Linux laptop battery life

Posted by: Anonymous [ip: 218.18.23.42] on August 08, 2007 01:49 AM
Verizon is about the only place you can get the authentic RIM product and matching door. Most other sites are out of stock and even when they are in stock they have the black <a href="http://www.laptopbatterybbs.com/ACER/">battery</a> door which looks like crap.
We supply a large range of rechargeable Laptop Battery packs for your Laptop , All Laptop Battery in our www.laptopbatterybbs.com are made with high quality cells.

#

Re: Intel and PowerTOP extend Linux laptop battery life

Posted by: Anonymous [ip: 59.40.71.114] on October 16, 2007 11:58 AM
We have specialist retailers of new laptop battery, notebook battery. We list a huge range of brands such as ACER, TOSHIBA, COMPAQ, Dell , FUJITSU and more.<a href="http://www.batteryfast.com/acer/btp-73e1.php">btp-73e1</a>
<a href="http://www.batteryfast.com/acer/btp-agd1.php">btp-agd1</a>
<a href="http://www.batteryfast.com/acer/btp-42c1.php">btp-42c1</a>
<a href="http://www.batteryfast.com/acer/btp-650.php">btp-650</a>


#

HI Everyone

Posted by: Anonymous [ip: 216.11.189.150] on September 18, 2007 01:32 PM
adfdasfsdfsad

#

Intel and PowerTOP extend Linux laptop battery life

Posted by: Anonymous [ip: 218.17.248.123] on October 11, 2007 12:23 AM
Verizon is about the only place you can get the authentic RIM product and matching door. Most other sites are out of stock and even when they are in stock they have the black battery door which looks like crap. We supply a large range of rechargeable Laptop Battery packs for your Laptop , All <a href="http://www.batteryfast.com">Laptop Battery</a> in our www.batteryfast.com are made with high quality cells.

#

Intel and PowerTOP extend Linux laptop battery life

Posted by: Anonymous [ip: 59.40.71.114] on October 16, 2007 11:59 AM
We have specialist retailers of new laptop battery, notebook battery. We list a huge range of brands such as ACER, TOSHIBA, COMPAQ, Dell , FUJITSU and more.
<a href="http://www.batteryfast.com/acer/btp-39d1.php">btp-39d1</a>
<a href="http://www.batteryfast.com/acer/btp-550.php">btp-550</a>
<a href="http://www.batteryfast.com/acer/batcl32l.php">batcl32l</a>
<a href="http://www.batteryfast.com/acer/batcl50l.php">batcl50l</a>

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya