User: Password:
|
|
Subscribe / Log in / New account

Van de Ven: On the changing role of PowerTOP

On his blog, Arjan van de Ven reflects on the changes in how the PowerTOP utility is being used, with an eye toward restructuring it. "So it's now time to rethink some of the code and make things much more scalable for adding new checks and features. In addition, the output also needs to improve to be more useful as a diagnostics tool. I'm thinking about adding a 'generate a report' option, that basically gives a complete report card of the system. [...] This doesn't mean I want to leave the end user behind; not at all. But in terms of new features, with all the low hanging fruit taken care of, some of the things PowerTOP needs to do are just a lot more technical than what PowerTOP 1.0 offered."
(Log in to post comments)

Van de Ven: On the changing role of PowerTOP

Posted Aug 10, 2010 19:47 UTC (Tue) by ncm (subscriber, #165) [Link]

The most useful possible single improvement would be to run in non-curses mode and just dump events and suggestions to stdout as a log. An actual report would be nice, but an unnecessary luxury.

On my Intel i5 laptop, by the way, it reports that the HDA "IbexPeak" HDMI codec keeps the CPU awake continuously.

Van de Ven: On the changing role of PowerTOP

Posted Aug 10, 2010 20:06 UTC (Tue) by ncm (subscriber, #165) [Link]

Sorry, that's the IDT 92HD81 "Single Chip PC Audio System", and it's not clear if it's keeping the CPU awake, or just refusing to shut off itself.

Of course Firefox 3.5 is still the overwhelmingly most frequent source of wakeups.

Van de Ven: On the changing role of PowerTOP

Posted Aug 10, 2010 22:44 UTC (Tue) by arjan (subscriber, #36785) [Link]

likely something is keeping the codec awake
that's about 0.5W of power... which shouldn't be there unless you're actually playing audio.

lsof may be able to tell you who keeps the audio awake.....

Van de Ven: On the changing role of PowerTOP

Posted Aug 11, 2010 0:53 UTC (Wed) by ncm (subscriber, #165) [Link]

Thank you.

It appears the module snd_hda_codec_idt was ignoring power-down commands; powertop kept saying "hit A", but it had no effect. I rebuilt the module with a 5-second "default timeout" (SND_HDA_POWER_SAVE_TIMEOUT, under "aggressive power-saving on HD-Audio" SND_HDA_POWER_SAVE) and now it is quiescent. (Debian has this timeout set to 0 in their build, as I had. Maybe that needs fixing.)

Strangely, powertop now only ever offers one suggestion, "S" for SATA ALPM.

Would "kill -STOP" pause Firefox nondestructively?

Van de Ven: On the changing role of PowerTOP

Posted Aug 11, 2010 5:14 UTC (Wed) by ncm (subscriber, #165) [Link]

Not strangely. Of course powertop's adjustments persist until re-boot.

And "killall -STOP firefox-bin" followed later by "killall -CONT firefox-bin" does indeed work as expected. Those will make good buttons in the panel.

But now I wonder what this IDT chip is really for. It doesn't appear in mixer panels...

One last question for Arjan: powertop identifies the sources of all but about 20 wakeups per second. Is there any clue as to where the rest come from?

capless

Posted Aug 11, 2010 8:20 UTC (Wed) by ncm (subscriber, #165) [Link]

OK, the IDT chip is just an amplifier. "Capless" means it doesn't need capacitors in the path to the speakers, reducing parts count and eliminating a source of distortion.

changing snd powersave timeout at runtime

Posted Aug 11, 2010 15:17 UTC (Wed) by sebas (subscriber, #51660) [Link]

IIRC there is a kernel option to set the timeout at runtime, I can't look it up right now, but maybe someone else has the path handy?

Van de Ven: On the changing role of PowerTOP

Posted Aug 10, 2010 22:43 UTC (Tue) by arjan (subscriber, #36785) [Link]

just a "dump" exists already, via

powertop -d

with a report I want it to become more of a checklist/health item rather than just dump what's on the screen.

Van de Ven: On the changing role of PowerTOP

Posted Aug 11, 2010 3:03 UTC (Wed) by PhracturedBlue (subscriber, #4193) [Link]

Powertop was very useful at reducing the wakeups CPU per second, and getting my into a lower power state for longer, but I found that this didn't have high correlation to actually reducing system power on my netbook. It isn't really powertop's fault, but it would be interesting to have a breakdown of how power is used in the system, as opposed to focusing entirely on the CPU.

Also, powertop does not always document how to apply its recomendations permanently, which means starting powertop occasionally to enable things like USB autosuspend which despite my attempts to apply manually, I only see a power drop when enabling through powertop.

Van de Ven: On the changing role of PowerTOP

Posted Aug 11, 2010 4:09 UTC (Wed) by arjan (subscriber, #36785) [Link]

reducing the wakeups per second saves power to a point.... where this point is depends on your exact hardware. It also depends on if USB is in autosuspend or not (if it's not, that point of diminishing returns is waaaay earlier, because USB that's not in autosuspend disables some of the more advanced power saving features).

as for your remark about the recommendations... you're absolutely right; the suggestion system was more or less bolted on to PowerTOP near the end of the original development, and has grown way out of hand... this is one of the parts that needs a complete rethink to get it done much better... including a way to automate applying some suggestion from a script.

Van de Ven: On the changing role of PowerTOP

Posted Aug 12, 2010 21:16 UTC (Thu) by ranmachan (subscriber, #21283) [Link]

Speaking of USB autosuspend, I've got a usb memory stick that seems to prevent USB suspend (even if not mounted) due to being 'active 100.0% of the time'. Is that expected? Shouldn't usb-storage suspend if the device isn't in active use?

Van de Ven: On the changing role of PowerTOP

Posted Aug 15, 2010 2:43 UTC (Sun) by Alan.Stern (subscriber, #12437) [Link]

"Speaking of USB autosuspend, I've got a usb memory stick that seems to prevent USB suspend (even if not mounted) due to being 'active 100.0% of the time'. Is that expected? Shouldn't usb-storage suspend if the device isn't in active use?"

It should, but up until now it hasn't because of lack of runtime power management support in the SCSI layer. That support has now been merged for 2.6.36, and both sd and usb-storage will autosuspend when the device's file isn't open (if you give them permission by writing "auto" to the appropriate power/control files in sysfs).

Of course mount keeps the device file open, so your memory stick has to be unmounted for you to derive any benefit. This is less than ideal, but it is currently necessary because some devices don't react well to being spun down and then spun up again every few seconds. Believe it or not, the kernel has no way to tell the difference between a USB-attached (S)ATA drive and a USB flash drive.

Even worse, many card readers lose track of whether or not a card is inserted when they go to low-power mode. Upon returning to full power, if a card is present they always report that it is a new card. The kernel believes them, which isn't good if you had a filesystem mounted on the card at the time.

In the end, we'll probably need some way for the user to specify that the drive should go to low power either:

(o) after some period of inactivity, ranging perhaps from 100 ms up to 3600 s;

(o) when the device file is not open;

(o) when the device file is not open and no medium is present.

This is all still under development. Another problem is the constant probing carried out by desktop management programs like hal. It's hard to save energy by remaining in a low-power state when a program wants to use the device every 2 seconds to see if the removable media has been inserted or removed.

Van de Ven: On the changing role of PowerTOP

Posted Aug 11, 2010 12:16 UTC (Wed) by maurizio.dececco (guest, #6585) [Link]

I got the same "problem": tried to include in a script all the powertop suggestions, but no hope, without running powertop i got no effects, or errors or both.

What about a nice option to ask powertop to just apply all the suggestions without asking ? On my portable (x61 with an Intel SSD), ubuntu 10.04 power on to the desktop in around 10 seconds, then i need one minute more to discuss with powertop on how bring down power ... :-< it would be nice
if i could just run powertop from a script and getting things done automatically ...

Maurizio

Van de Ven: On the changing role of PowerTOP

Posted Aug 12, 2010 4:09 UTC (Thu) by bronson (subscriber, #4806) [Link]

I'm not sure I agree with this... PowerTop makes a great monitoring and experimentation tool but I don't think it should become an integral part of the OS.

If your laptop boots into a suboptimal power mode, that's a problem with your distro, no? I would start filing bugs there.

Van de Ven: On the changing role of PowerTOP

Posted Aug 12, 2010 8:36 UTC (Thu) by maurizio.dececco (guest, #6585) [Link]

Sure, i am not talking about integrating it in the OS.
But since powertop can do the actions, why do not give the options to script it, even for the actions, waiting for those bug reports to be taken in account ?

Van de Ven: On the changing role of PowerTOP

Posted Aug 12, 2010 13:40 UTC (Thu) by arjan (subscriber, #36785) [Link]

you're absolutely right, I've wanted to add this to PowerTOP for a long time, but the internal architecture of the code just doesn't make this really possible....
... this is one of the things that will be rearchitected .... it's a very valid request to be able to do this.

Currently I'm thinking that there needs to be a way for every single suggestion to have a command line thing, and then also a way to do "all", for those who want that.

Van de Ven: On the changing role of PowerTOP

Posted Aug 11, 2010 15:00 UTC (Wed) by gdamjan (subscriber, #33634) [Link]

I have 2 questions:

What the hell is going on with Rescheduling interrupts <kernel IPI>
Top causes for wakeups:
49,7% (397,7) [Rescheduling interrupts] <kernel IPI>
14,7% (117,7) [kernel scheduler] Load balancing tick

and,
the suggestion "iwconfig wlan0 power timeout 500ms" doesn't work on iwl3945

My hardware is X60s (all intel) and kernel is 2.6.35.1 now

Van de Ven: On the changing role of PowerTOP

Posted Aug 22, 2010 23:17 UTC (Sun) by shapr (guest, #9077) [Link]

I had a weird power problem with my Lenovo X61.
Hours of google searching turned up "ifdown eth0" as a way to fix the problem until the next reboot.
The actual solution suggested in the thread was to shutdown my Lenovo laptop, remove the battery, wait 15 minutes, and the ethernet port will no longer have problems.

Surprisingly enough, this really did work, and works for a large number of Lenovo models according to the thread (which I can't find at the moment). I can only assume Lenovo has firmware problems?

On the subject of PowerTOP, I love it, and I want more!
It's oh so useful, and saves me battery power and leg burning.

Van de Ven: On the changing role of PowerTOP

Posted Aug 13, 2010 14:22 UTC (Fri) by jo42 (subscriber, #59640) [Link]

I would like to see support for other architectures in PowerTOP, especially powerpc. It's useless to recommend setting kernel options (like CONFIG_HPET_TIMER) they aren't available on powerpc or complaining about missing ACPI support. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=463034

Van de Ven: On the changing role of PowerTOP

Posted Aug 15, 2010 15:15 UTC (Sun) by maks (subscriber, #32426) [Link]

Not sure if userspace is really as ``fixed'' as powertop author suggests. Common usage pattern shows lots of gnome desktop wake-ups, for example: An otherwise idle rhythmbox ranks high in the caused wake-ups pattern. Same with old ``friend'' firefox^Wiceweasel.

Van de Ven: On the changing role of PowerTOP

Posted Aug 21, 2010 17:50 UTC (Sat) by oak (guest, #2786) [Link]

> Same with old ``friend'' firefox^Wiceweasel.

Fixing all of those would require fixing the internet. The wakeups are timers in JavaScript code (like Gmail), animated images (like some LWN adverts), Flash etc.

Sure, there are also issues in Firefox (extra wakups), but I think there bugs about them in Mozilla bugzilla and they're being (have to be) fixed as Mozilla is going mobile...

Van de Ven: On the changing role of PowerTOP

Posted Aug 22, 2010 11:32 UTC (Sun) by dlang (subscriber, #313) [Link]

some of those things are being fixed, chrome has the option to halt scripts/animations on windows that are not visible


Copyright © 2010, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds