Archive for November, 2009

Some PowerTOP updates

Saturday, November 14th, 2009

In the last few days I’ve been working with Auke Kok on adding some new features to the PowerTOP tool.

There are three new power saving checks in the current git version of PowerTOP. Each feature needs a small kernel patch to give PowerTOP the information it needs; the three patches are currently making their way through the various maintainer trees and code reviews, hopefully for inclusion in the 2.6.33 kernel.

Test 1: Who is spinning up the disk
Not everyone has an SSD in their system yet (I feel sorry for those who don’t). The mechanical rotation of a disk seems to cost in the order of 0.5 Watts to 1 Watt of power (depending on the disk).
For this reason, pretty much all laptop disks will stop spinning after several seconds of inactivity.

Now, to enjoy this power savings, it is essential that the disk gets to actually spin down, that is, that there are long periods of inactivity. In a typical Linux distribution, there are various programs that, unfortunately, write things to the disk all the time. Until now, the only way to find out which programs were doing this was to use the blockdump kernel feature.

blockdump is not very user friendly, and while powerful, has several caveats.

Using the perf kernel infrastructure, the git version of PowerTOP now has included the equivalent of the blockdump feature, and will report disk-waking application both in the regular interactive
view as well as in the diagnostic “dump” mode.

In the interactive mode, disk activity is shown with a “D” in the line like this:

Top causes for wakeups:
5.9% (441.0) <interrupt> : ahci
0.0% ( 0.0)D gcc

and in addition, a suggestion will show up in the bottom pane like this:


The program 'cc1' is writing to file '.oom_kill.o.d' on /dev/sda3.
This prevents the disk from going to powersave mode.

While in the “dump” mode a full list of file accesses is shown:


Disk accesses:
The application 'gcc' is writing to file 'ef7f9d8f6d628ba196edb8882ed560-' on /dev/sda3
The application 'gcc' is writing to file '?' on /dev/sda3
The application 'gcc' is writing to file 'sysctl.o.BvmMr0' on /dev/sda3

We used this feature to make sure that the Moblin OS keeps the disk in low power mode as long as possible.

Test 2: Is the audio power saving working

PowerTOP has been suggesting to enable the power saving feature of the HD Audio chipset. In power save mode, the so called “codec” (the chip that turns the digital signal into the analog voltages that speakers can then turn into sound) will be turned off during periods when no applications use the sound subsystem. This can easily save 0.25 Watts to 0.5 Watts.

However, as usual, this savings is only achieved when no application is actually using the sound subsystem. The git version of PowerTOP will now show statistics
about how much of the time the audio codec is in power save mode.

In dump mode, the output looks like this:

Recent audio activity statistics
Active Device name
0.0% hwC0D2

while equivalent information is shown as a suggestion in interactive mode if there is activity on the audio chip.

Test 3: Is SATA Link power management working

PowerTOP has checked the ALPM AHCI Link power saving feature for quite some time now. This feature is good for between 0.5W and 1W of power per Serial ATA link
when the link is quiet. Now, of course this is only helping if the link is actually quiet….

The git version of PowerTOP will now display actual statistics of the various Serial ATA links in the system to measure the effectiveness of this feature,
as well as pointing out potential tuning spots.

In dump mode, on a busy system this will look like this:

Recent SATA AHCI link activity statistics
Active Partial Slumber Device name
86.5% 13.5% 0.0% INTEL SSDSA2MH08

While on a more idle system it looks like this:

Recent SATA AHCI link activity statistics
Active Partial Slumber Device name
0.8% 99.2% 0.0% INTEL SSDSA2MH08

In interactive mode, the same information will be displayed in the suggestion portion of the screen.