Bug 294120

Summary: powertop optimizations
Product: [openSUSE] openSUSE 10.3 Reporter: Péter Kerékfy <kerekfyp>
Component: KernelAssignee: Jeff Mahoney <jeffm>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P5 - None CC: behlert
Version: Alpha 6   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Péter Kerékfy 2007-07-24 10:14:31 UTC
Hi!

I have installed powertop 1.7 on my notebook computer. It suggests to enable the following kernel options:

CONFIG_USB_SUSPEND
CONFIG_NO_HZ

I dont know much about the side-effects of these options but I think it worth to consider enabling them.

Regards, 
Peter.
Comment 1 Greg Kroah-Hartman 2007-07-24 17:00:57 UTC
CONFIG_USB_SUSPEND is just still too "new" to use right now in our kernels, there are a lot of devices out there that do not like it, our quirk table is still growing to handle this.

As for CONFIG_NO_HZ, I'll let Jeff make that call :)
Comment 3 Pavel Machek 2007-07-25 10:43:46 UTC
I played with a NO_HZ some time ago (2.6.21 days) and it was a disaster. I can try to reenable it locally and retest, but I do not think we should ship that for 10.3.
Comment 4 Pavel Machek 2007-07-25 12:04:18 UTC
Well, it seems to work better these days (with 2.6.23-rc1-pre), but it is fundamental change that affects pretty much whole  kernel, and I do not think this is mature enough. We probably want to enable it early in 10.4 cycle.
Comment 5 Jeff Mahoney 2007-07-27 15:36:40 UTC
After some discussion, we've decided to enable CONFIG_NO_HZ in the openSUSE kernels. The KOTD releases will contain the change tomorrow, as will the next alpha.
Comment 6 Péter Kerékfy 2007-07-31 11:31:23 UTC
I have installed the kernel from http://download.opensuse.org/repositories/Kernel:/HEAD/openSUSE_Factory/ which has the NO_HZ flag turned on.

Then I found something strange in powertop: When the computer is completely idle (no beagled, no other crap) and nohz is turned on (the default) then the cpu spends about 40% of time on 2GHz and the rest of the time on 1GHz. With nohz=off the cpu spends 95% of time on 1GHz. (My system is a Core Duo 2GHz laptop.)

So it seems the nohz flag somehow confuses the ondemand cpu freq governor. Is it a known bug/feature? 

On the other hand nohz decreased the number of wakeups per second by 90%: from about 400 to 40. Very well.
Comment 7 Greg Kroah-Hartman 2007-07-31 20:14:21 UTC
The number of wakeups per second is the important thing, along with the projected battery life.

As for the speed, yes, it is much better to go as fast as possible to get the work done, and then drop down to nothing, than it is to run at a slower speed for a longer time.  It saves more battery life that way.

For more details on this, see Arjan's OSCON 2007 talk for pretty slides.
Comment 8 Péter Kerékfy 2007-07-31 20:28:13 UTC
Thanks for the explanation!

Note: with nohz enabled my system saves 1 watt of power compared to the previous kernel config (in idle mode of course). Now it runs on 14 watts. Well done :-)