Saving Power with Powertop BETTER SLEEP Intel’S Powertop Analysis Tool Helps Optimize Power Usage and Shows You the Power Guzzlers Hiding out On

Saving Power with Powertop BETTER SLEEP Intel’S Powertop Analysis Tool Helps Optimize Power Usage and Shows You the Power Guzzlers Hiding out On

KNOW-HOW PowerTOP Saving power with PowerTOP BETTER SLEEP Intel’s PowerTOP analysis tool helps optimize power usage and shows you the power guzzlers hiding out on your operating system. BY KRISTIAN KISSLING f you dual-boot your laptop with The CPU uses this signal to measure the tool will only show the C states oth- Windows and Linux, you may have the time; of course, if the CPU isn’t actu- erwise, and it will not say anything Inoticed a strange phenomenon – the ally doing anything, the tick just rudely about the power consumption of individ- battery lasts longer on Windows than wakes the CPU out of power save mode. ual system components. on Linux. When this happens, people To change this, dynticks were intro- The good news is that a couple of dis- normally start tweaking their systems – duced with kernel version 2.6.21, timer tros on the market already use kernel unloading modules for power guzzling ticks now only occur if the kernel really 2.6.21: Debian “Sid” and the Debian de- hardware, changing the ACPI settings, needs them. On 64-bit systems, the dyn- rivative Sidux – admittedly experimental and dimming the display. tick feature will appearl in kernel 2.6.23. Linux varients. OpenSUSE 10.2 and Recently, kernel developers have PowerTOP reveals what dynticks do – Ubuntu 7.04 “Feisty Fawn” don’t cur- started to put more thought into the and more. It displays values on the con- rently have updates for the kernel. power situation; thanks to new kernel sole that tell you how much time the features, you can reduce your system’s kernel spent in power save mode (Figure Build Your Own power consumption. PowerTOP [1] is a 1). At the same time, the tool tells you Of course, you could always build a new tool that helps you manage and optimize which kernel software components are kernel of your own, but if this sounds power usage. waking up the kernel and thus helps you too much like rocket science, just wait optimize your system. Timer ticks are for openSUSE 10.3 or Ubuntu 7.10 Power Save Mode not the only thing that interrupt the ker- “Gutsy Gibbon.” Both systems will have A CPU will normally switch to a power nel’s siesta; non-optimized software the new kernel and probably packages save mode if the user falls asleep in front components – Gksu, for example – wake for PowerTOP. of the keyboard – or at least in theory. the kernel more often than necessary. If you do decide to build a brand new What actually happens with legacy ker- kernel, you can download the kernel nels is that an internal clock, the static Kernel Panic from Kernel.org [2]. The following exam- timer tick, occurs about a thousand Newcomers might be a bit worried about times per second. needing kernel 2.6.21 to run PowerTOP – Daniela Benzler, Fotolia Benzler, Daniela 54 ISSUE 83 OCTOBER 2007 WWW.LINUX - MAGAZINE.COM PowerTOP KNOW-HOW After saving the modified .config file, build the kernel using the following command: sudo make-kpkg --initrdU --revision=i686ver1 binary This step creates .deb packages, which you can install and uninstall in the nor- mal way. The process is typically fairly slow – in fact, it can take hours to com- plete on a slow machine. When you are done, type sudo make-kpkg clean to remove unwanted files. Now change to the parent directory and install the new kernel by typing sudo dpkg -i kernel-image-version.deb. The command updates the Grub boot manager at the same time. If the GUI does not appear after re- Figure 1: PowerTOP tells you how often the CPU enters power save mode and which programs booting, you will need to change the wake it up again. nvidia entry below Section "Device" in your /etc/X11/xorg.conf to nv, or fglrx to ple explains how to build a kernel for then change directory to linux. The ker- ati, and then relaunch the display man- Ubuntu. Your mileage will differ depend- nel typically parses a configuration file ager. The new kernel needs new drivers ing on your distribution. Just make sure to find out which kernel options you will for 3D graphics acceleration support. you know what you are doing – if you be using. You may need to build modules manu- slip up, you might not be able to boot ally for your WLAN or graphics card and the system. Template apply a couple of patches. The following HOWTO is designed for It is a good idea to use the configuration Even if your newly built kernel doesn’t “Edgy Eft” and “Feisty Fawn,” and it file for the existing kernel as a template support all your hardware, you will at basically draws from the Ubuntu wiki. for the new file; you will find the least find out which software is using up Start by installing the build-essential, file below config-CurrentKernel in the too much power. You can then make a kernel-package, xmlto, libncursesw5-dev, /boot directory. Give the sudo cp /boot/ note of the culprits and optimize them and libncurses5-dev packages. Then config-CurrentKernel .config command on the old kernel. download a current kernel with an ex- to copy your existing configuration, and tension of tar.bz2 from Kernel.org to a save the configuration as a hidden file Installing PowerTOP directory of your choice. in the /usr/src/linux directory – typing The next step is to download the latest Change to the directory you chose and ls -la should list the file (Figure 2). version of PowerTOP. Unpack the ar- type sudo tar xvjf linux-2.6.21.5.tar.bz2 chive, change to the new directory, and -C /usr/src to unpack the kernel, taking Configuration type make to build the software. care to replace 2.6.21.5 with the version The new kernel is bound to include new you are using. configuration settings. sudo make old- Kernel Options Next, change directory to /usr/src and config prompts you to decide what to do According to the FAQ, you need to create a symbolic link called linux that with each new option. The best ap- enable the following options in the points at the directory with the kernel proach is to press Enter in each case to configuration file: you just unpacked, accept the defaults, which are then auto- • CONFIG_NO_HZ matically dropped into your .config file. • CONFIG_TIMER_STATS sudo ln -sU You can edit the file later (you need root • CONFIG_HIGH_RES_TIMERS /usr/src/linux-2.6.21.5U privileges to do so) to enable and disable /usr/src/linux various kernel options, as described by • CONFIG_HPET the FAQ on the PowerTOP page [3]. • CONFIG_CPU_FREQ_GOV_ONDE- GLOSSARY The “Kernel Options” box lists the op- MAND C States: Idle states of ACPI-capable tions. For example, to enable the CON- • CONFIG_USB_SUSPEND FIG_NO_HZ option, you need to change CPUs. Four phases range from C1 (idle) • CONFIG_SND_AC97_POWER_SAVE to C4 (stopped processing). The higher the # CONFIG_NO_HZ is not set to CON- Disable the following features: the number, the less power the CPU FIG_NO_HZ=y (Figure 3). Reverse this • CONFIG_IRQBALANCE consumes. Core-Duo CPUs also have a procedure to disable an option – and deep state C4. don’t forget the pound sign! • CONFIG_ACPI_DEBUG WWW.LINUX - MAGAZINE.COM ISSUE 83 OCTOBER 2007 55 KNOW-HOW PowerTOP makers, organized hierarchically by the frequency with which they interrupt the CPU. PowerTOP occasionally displays a third black bar in the footer line with a letter and the name of an active process causing a number of wakeups. If you press the letter, PowerTOP sends a kill signal to the process. Minor edits to configuration files can drastically change the hacking order in the power guzzler charts. Conclusions Most of the time, you need to install special patches to reduce the power consumption of individual programs. For example, if you add a line for Option "NoDRI" to the Section "Device" part Figure 2: After you copy the configuration file for the existing kernel to the /usr/ src/ linux of your /etc/X11/xorg.conf, the <inter- directory, you can customize the kernel options in the .config file at a later stage. rupt> i915@pci entry will disappear out of the charts. Then launch the software directly to Wakeups-from-idle; it tells you how Before you can tackle some candi- from the same directory simply by typ- often the CPU wakes up from idle state dates, you must find out which program ing sudo ./powertop. per second. is hiding behind the cryptic name, such This value should be as low as possi- as i8042. In this case, the mailing list [4] Power Hogs ble – the website claims you can reduce and the Tips & Tricks section [5] on the If you believe what Intel claims, Power- a three-figure number to single figures. PowerTOP website can help. The FAQ TOP works best on laptops with Intel This might work in theory, but you [3] reveals that i8042 refers to the kernel CPUs. C state information is only for would need a whole bunch of patches driver for the mouse and keyboard – mobile CPUs in laptops. With AMD sys- and workarounds. don’t be surprised if you see this entry tems, desktop users can at least measure when you investigate your system’s the power consumption of individual Battery Life power consumption with PowerTOP. ■ programs. The line below Wakeups tells you how PowerTOP displays various values (see long your laptop’s batteries are likely to INFO Figure 1).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    3 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us