Intel Powertop is great (with a twist)

I’ve been playing around with my Gutsy install on the laptop. Since it uses a tickless kernel (2.6.22), I decided to give powertop a chance and see what’s ticking away my computer. To do a somewhat informed analysis, I tried a couple of scenarios, all with wireless transmitting and without to see how that affects things. Here is what I’ve found so far, in a couple of powertop pastes:

Scenario 1. Default boot with no wireless data:

Wakeups-from-idle per second : 117.8    interval: 15.0s
Power usage (ACPI estimate): 18.7W (2.5 hours)
Top causes for wakeups:
52.5% ( 60.2)       uhci_hcd:usb1, yenta, fglrx
19.1% ( 21.9)       uhci_hcd:usb2, ipw3945, HDA Intel

Note: My how usb misbehaves even with nothing plugged in. And what is yenta doing there, since I have no card in the pcmcia slot ? Also, somebody give fglrx a valium.

Scenario 2. Default boot – wireless full steam

Wakeups-from-idle per second : 482.7    interval: 15.0s
Power usage (ACPI estimate): 20.1W (2.3 hours)
Top causes for wakeups:
87.4% (881.6)      uhci_hcd:usb2, ipw3945, HDA Intel
6.0% ( 60.2)        uhci_hcd:usb1, yenta, fglrx

As expected, full steam wireless transfers brings up the wakeup count.
Powertop optimizations: powertop provides a series of suggestions that supposedly save power. Here is what powertop suggested and I willingly complied to:

  • Wireless powersaving
  • Usb autosuspend
  • Vm dirty writeback from 5 to 15 seconds
  • laptopmode 5
  • Remount the filesystem with noatime

And next is what I found.

Scenario 3. Powertop optimizations and no wireless

Wakeups-from-idle per second : 111.2    interval: 15.0s
Power usage (ACPI estimate): 17.4W (2.6 hours)
Top causes for wakeups:
48.8% ( 60.2)      : uhci_hcd:usb1, yenta, fglrx
33.0% ( 40.7)      : uhci_hcd:usb2, ipw3945, HDA Intel

After all the optimizations, only a few less wakeups per second. That weird, because usb and yenta are still up there, along with wireless (ipw3945) and sound (HDA Intel) for some odd reason. fglrx is on steroids.

Scenario 4. Powertop optimizations and wireless

Wakeups-from-idle per second : 367.0    interval: 15.0s
Power usage (ACPI estimate): 19.1W (2.4 hours)
Top causes for wakeups:
83.3% (599.7)       : uhci_hcd:usb2, ipw3945, HDA Intel
8.4% ( 60.2)         : uhci_hcd:usb1, yenta, fglrx

Now here is something interesting. Probably wireless powersaving, but it saves around 115 wakeups per second. This is nice.
Afterwards I started removing stuff that just seams to take up space.

rmmod uhci_hcd pcmcia yenta_socket

This is because I don’t have pcmcia cards or usb stuff connected to the laptop.

Scenario 5. Powertop optimizations, Modules removed, no wireless

Wakeups-from-idle per second : 96.5     interval: 15.0s
Power usage (ACPI estimate): 17.1W (2.6 hours)
Top causes for wakeups:
63.1% ( 60.3)      : fglrx
14.9% ( 14.3)      : ipw3945, HDA Intel

Now we are getting somewhere. About 20 wakepus less. That seems to be misbehaving modules (pcmcia, usb). fglrx is still jumpy (how sad).

Scenario 6. Powertop optimizations, Modules removed, Wireless

Wakeups-from-idle per second : 259.7    interval: 15.0s
Power usage (ACPI estimate): 18.2W (2.4 hours)
Top causes for wakeups:
73.4% (324.5)      : ipw3945, HDA Intel
13.6% ( 60.2)       : fglrx

Now that is a boost. About 100 less wakeups per second. Strange, but nice. What does usb/pcmcia have to do with wireless transfers ?
So I took it another notch and removed the two Intel modules – ipw3945 and HDA Intel (sound).

rmmod snd_hda_intel ipw3945

Scenario 7. Powertop opts, more modules removed, wireless removed

Wakeups-from-idle per second : 69.6     interval: 15.0s
Power usage (ACPI estimate): 17.6W (1.8 hours)
Top causes for wakeups:
84.2% ( 60.2)     : fglrx

Nice, but maybe just for offline usage. Comparing this with the other results, well, it seems that even on idle wireless takes up space. Down fglrx, down boy!

Now here is the final twist : Stopped X and remove that nasty fglrx

Scenario 8. Powertop opts, modules removed, wireless removed, fglrx removed

Wakeups-from-idle per second :  4.8    interval: 15.0s
Power usage (ACPI estimate): 19.3W (1.6 hours)
Top causes for wakeups:
23.3% (  1.3)   kernel core: queue_delayed_work_on
22.1% (  1.3)   acpi

A comfortable 4.8 wakeups per second. I just wish my laptop was like this while on idle (with all my apps running) …

Scenario 9. Powertop opts, clean boot, wireless stopped, running the vesa driver instead of fglrx:

Wakeups-from-idle per second :  6.1     interval: 15.0s
Power usage (ACPI estimate): 15.3W (3.0 hours)

That’s really nice. On a clean boot, with vesa, wakepus go down. Nor USB nor pcmcia stick out like a sore thumb. It seems almost magical. Those 6 wakeups are with X server running. But this made me wonder. Did I foul up with fglrx ? I redid the test, in the same conditions as the previous (#9), but with fglrx.

Scenario 10. Powertop opts, clean boot, wireless stopped, fglrx:

Wakeups-from-idle per second : 69.8     interval: 15.0s
Power usage (ACPI estimate): 16.8W (2.7 hours)

That’s more than a 1W of power draining towards fglrx. I noticed that powertop seems to bundle things. Maybe the yenta stuff is fine, and fglrx reports it with along with flgrx, since it probably can notice the difference from the bunch who is causing the wakeps, just like ipw3945 and the snd_hda modules.

Final thoughts

  • Intel, what a twist! Powertop is really useful,. But in a twist of fate, the modules that take up more wakeups, and keep my intel cpu from going into C3 state are Intel modules. This could should be fixed. This might be a buggy wireless driver. Also there can be lack of means for powertop to tell the difference between ipw3945 from snd_hda_intel wakepus, since using just the snd_hda_intel module (with no wireless), the wakeups stop.
  • I noticed that using the touchpad or the keyboard yield about 500-800 wakepus per second. Is this really necessary ?! Or is there a fix for this. I seen a fix for the macbook on www.linuxpowertop.org, maybe my thouchpad needs something of the kind… Here is a sample:
47.4% (494.2)      PS/2 keyboard/mouse/touchpad
  • The ATI Video Driver (fglrx) is high on caffeine. It does a constant 60 wakeups per second. It’s not on behalf of any X app, because I killed most of them while testing it (by advice of powertop’s online tips). There is probably a bug in there somewhere that makes this very annoying and jumpy. But I haven’t complained, since this might have a _solution_ in the near future… Going with Vesa saves me over a 1 Watt of power.
  • This is just using stock ubuntu packages. I’m still to follow some of powertop’s tips, that are online. Really nice when running powertop+vesa driver, this really gives me more battery time. I started out with 18.7 and ended up with 16.8, almost 2 watts of power, which is something to notice.

UPDATE:

Updating the fglrx binary driver to the lastest version 8.41 fixes the jumpiness and dramatically cuts down the wakeups per second. Don’t believe me ? Here’s the result with all the powertop suggestions activated:

Wakeups-from-idle per second :  7.5     interval: 30.0s

Pretty damn sweet! Bring on the Gutsy Gibbon.

September 28, 2007

Anti-Procrastination Tips

After starting to getting things done, I noticed that I still procrastinate. Procrastination is evil. There should be religions around Anti-Procrastination, gathering in cults and praying to keep procrastination at bay.

With this in mind I’ve picked up a few tips, here and there, that help me to avoid procrastination:

Mail client auto -update only every two hours

Teach yourself not to have the email client open. If you have to, then turn the auto-check for messages to a two hour interval. If your email was that critical that needed to be checked once or twice a minute, someone would call you. Other than that, it’s even good discipline to let it sit for a couple of minutes in your inbox so you can reply to your mail with a clear head. While your at it, you can also clean your Inbox. If you don’t know hot to do it, check out Inbox Zero, some great stuff there. Having a clean Inbox lets you focus on what’s important, and kill that weird feeling of having your email application closed, because you don’t feel like you could be doing something on you inbox, and you also don’t fiddle with your mail in endless loops.

Feeds twice a day

Must of us have RSS feeds. I like using Liferea to check for fresh news straight out of the feed pipe. But you should teach yourself to check twice a day, max. I try to do it once in the morning and once at night. But close your RSS application afterwards, because if not, you’ll end up clicking that evil update button, and procrastinating just a little more. Open it, read it, close it and be done with it. You’ll enjoy more having a bunch of feeds to read, with useful information, and you’ll also skip the crap more willingly, i.e. you won’t read a feed just because it’s the only new thing on your plate.

Browser scrapbook/notes

As all modern people, I use instant messaging, it’s become a work tool. But, it’s incredible the amount of people that paste links on your chat window. Be it for fun, for info, for work, for teasing or just bothering, everybody has a link to share. Youtube, google video, metacafe, digg, engadget, slashdot, you name it, everybody always has something. If you always go through those links right away (hey, my IM windows popped up or flashed), you’ll waste a couple of hours every day. To kill this procrastination evil seed (yes, because when you’re on youtube you have to check out a couple of related videos also, and things are getting not done), I came up with a strategy. Use a scrapbook. Firefox has it. If not, use tomboy notes. If not, use a text file. Put all those links in the same place, and check them out at night, when you’re at home relaxing. You’ll laugh harder and feel more relaxed (you won’t be trying to hide your screen deep in your cubicle).

That’s all the pearls of wisdom so far. Hope it helps any other lost soul besides me…

September 18, 2007

Compiling the new RadeonHD open source driver on Ubuntu Feisty

So SUSE/Novell really came through, taking advantage of AMD’s recently released specs to provide us with a new open source driver. It’s still fresh out the gates, so don’t expect a bulletproof or even fully working driver. Thanks and credits go to a few wonderful developers like libv, egbert and emmes.

For more news on this release, go here.

This really is wonderful news. Not even the “95% chance that it will not work on your card yet” notice on freenode#radeonhd will stop anyone from enjoying this release.

So given it was released today, here is how I compiled it from git.

First get the source.

git clone
git://anongit.freedesktop.org/git/xorg/driver/xf86-video-radeonhd/
xf86-video-radeonhd

Now setup a few packages (I am not sure that’s every single on of them, since I already had some in my system):

sudo apt-get install  x11proto-fonts-dev x11proto-randr-dev
x11proto-video-dev x11proto-xext-dev x11proto-render-dev
xlibs-dev xserver-xorg-dev

Also, make sure you already have the proper tools for compiling it:

sudo apt-get install build-essential automake autoconf libtool

Now just go into the xf86-video-radeonhd dir and type:

./autogen.sh && make

If autogen.sh doesn’t crap out, you should be able to compile it successfully. If it does crap out, than leave a comment so I can add the proper package name to this small guide. Now onto testing fun. More on that probably tomorrow.

It’s a(nother) good day for open source.

September 17, 2007

Going GTD

I’ve recently read the famous book by David Allen, Getting Things Done. I have to say that it was very good reading which I enjoyed thoroughly and really has motivated me on Going GTD. In spite of some things being common sense, you get the Columbus Egg feeling wanting to strike a big “AHA!”. Some of the things on the book people do instinctively, but others we just foul up terribly and lose north. For me there are two major points that I get from the book, which really help:

  • Next Actions
  • Lists

Next Actions

There is nothing like having next actions for your plans or for your To Do list. One thing I use to do was to roam endlessly through my To Do Lists, trying to pick something to do, and eventually procrastinating as hell, since I couldn’t find a bone to chew on. Now, I know that my lists were in a such messed up state, that I would consider myself a hero if I had done something exceedingly positive with them. I need concrete things to get moving. And also, small things I can strike out, marking them done, and then feeling good about them and myself. And a major hint I picked, brainstorming is a To Do Item, even though I always never considered it. A person can schedule “thinking about this” as next action. And for me, it was about half of my Items!

Lists

Make lists. And when you’re done, make more lists. And when you’re done doing that, update your lists. Small lists, big lists, medium lists, everything is useful, as long as it captures you’re current thoughts, and “vacuums” your mind. I keep at least two lists. If you read the book, i keep a 20.000 feet list. That is, something were I keep what a project is, what it means to me and what I want from it. This is the core point: – what I want from the project. It’s the most useful way of getting things in order. I found out that about a third of my stuff I don’t even care about, so just dump it. And that allowed me to regain focus on the other things. The second list is my Next Actions list, where I detail things to a point where I can just do them. I can’t express how useful this is.

But don’t take my word for it, read the book. Even though some parts of the book might not have been that interesting to me (I’m not actually going to use a tickler file), it’s still easy reading and gives out a few thoughts (I went out and got in baskets, oh joy).

On another positive note, this new methodology has really decreased my procrastination index, and I’m actually more productive, which is nice. But more on procrastination later, since I also picked up a few tricks that I’ll share in the future.

September 17, 2007

Terrarium 1.0 – The House of Gimli

For those of you who don’t know, I have a (about) three year old male iguana, called Gimli. That’s him below, shedding his skin. He’s still greenish and seems to be staying that way in the future, except when he’s in heat, where he takes on an orange groovy look.

Gimli

And so the House of Gimli has entered it’s first final release reaching the 1.0 milestone. This means it has full lighting, accessories and doors. That was the last final hardy step, put some doors on the bottom shelves. All in all, it’s a solid construction and I am proud of it. Alot of people contributed to this artwork, which was in the making for 2-3 long years. So thanks everyone for the help, you know you are (father, mother, sister, girlfriend, friend #1, friend #2, etc), couldn’t have done it without all the extra hammering, bolting, design opinion, etc, etc, etc… You can find a nice picture below of the “Terrarium 1.0″. And by the way, that’s a real plant in there, which my green iguana just chops away with huge bits (it was twice the size, the plant that is).

Terrarium 1.0

Well, and next ? Terrarium 1.1 is in the making. Better shelving, better humidity, eating place, resting place. An overall feature enhancement. So I don’t think I’ll ever get rid of all the tools, hammers, bolts laying around my room. Guess that’s how it’s gonna be. Enjoy the photos.

September 6, 2007