• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: cpuidle for a greener plug  (Read 7678 times)
jmknapp
Newbie
*

Karma: 0
Posts: 45



View Profile
« on: May 11, 2009, 06:20:25 PM »

The current Marvell git kernel (2.6.30 rc3) includes supports for cpuidle, which to save power automatically shuts down the cpu (to varying degrees) when idle.  I compiled a kernel and made some measurements. First here's the output of powertop on a plug with a number of services running (apache, mysql, asterisk, gnome, snort, etc.) but not much load:



So, cpuidle was able to put the cpu into one of two idle states (C0 and C1) 8.0 + 82.7 = 90.7% of the time in this case. The actual power savings vary from C0 to C1. I hooked up an oscilloscope to measure the actual current waveform of this system and indeed it shifted between 3 levels. Roughly, in C1, the most idle state, power dissipation was 2.5W. In C0, 3.0W were consumed and with the cpu running, power was 4.0W. Just figuring from the powertop averages, that amounts to an average 0.827*2.5 + 0.08*3.0 + 0.094*4.0 = 2.7W for this example. That's a pretty good improvement from the 4.0W figure without cpuidle--basically the power consumption of the plug itself is cut by one-third (neglecting USB power).

Here's a scope photo that shows some typical switching between power levels:






Logged

iovnow
Newbie
*

Karma: 0
Posts: 16


View Profile
« Reply #1 on: May 11, 2009, 09:15:41 PM »

Very nice information.  Thanks for sharing.
Logged

Rabeeh Khoury
Administrator
Full Member
*****

Karma: 5
Posts: 218


View Profile
« Reply #2 on: May 12, 2009, 12:59:42 AM »

Thanks for sharing this information.
I'm assuming you done the measurement before the power supply, is it possible to measure AFTER the power supply on the +5V connector?
This way we can know what is the real power consumption of the electronics on the plug and not how much power is wasted on the power suplpply itself.

Logged

guerby
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #3 on: May 12, 2009, 01:00:08 AM »

This is coherent with what I measured with a basic killawatt:

http://www.mail-archive.com/debian-arm@lists.debian.org/msg09589.html

Quote
> Here is what I measured with an Energy Monitor 3000, SheevaPlug on 220V:
>
> 3.1W just on, Linux booted
> 3.3W serial
> 4.3W serial + ethernet
> 6.0W serial + ethernet + USB HDD
> 7.0W serial + ethernet + USB HDD + 100% cpu
>
> cos phi moves from 0.46 to 0.51. USB HDD is Lacie Porshe 120GB IDE with
> disk "SAMSUNG HM120JC version YL10", I use it for swap, root is on NFS.

Hi,

Thanks to two new patches queued for git://git.marvell.com/orion.git
idle consumption is significantly improved in my setup:

2.3W Idle with everything unpluged
3.3W Idle with gigabit ethernet
5.0W Idle with gigabit+HDD USB+serial
7.0W +100% cpu

cos phi is in the 0.5 range.

When cpu is loaded but not completely the power usage should also
be lower but it's harder to measure in my setup.

powertop 1.11 report on a mostly idle system:

Cn           Avg residency
C0 (cpu running)        ( 0.0%)
C0    9.8ms ( 0.5%)
C1  402.7ms (99.6%)

Kernel config options to enable:

CONFIG_NO_HZ=y
CONFIG_TIMER_STATS=y
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y

Also on the performance front: a native kernel compile from scratch with
"Gentoo 4.1.2 p1.3" GCC takes around 50 minutes.

Logged

jmknapp
Newbie
*

Karma: 0
Posts: 45



View Profile
« Reply #4 on: May 12, 2009, 03:34:58 AM »

I'm assuming you done the measurement before the power supply, is it possible to measure AFTER the power supply on the +5V connector?
This way we can know what is the real power consumption of the electronics on the plug and not how much power is wasted on the power supply itself.

I measured at the 5V connector (J3). That was easy to do since I rigged up a 5VDC supply with my own connector. That supply puts out 5.00V, so I could just multiply the measured current by 5.

The plug's standard power supply puts out 5.25V, open circuit at least, and from what I gather from the schematic, goes into some nifty Marvell-ous chips to provide all kinds of operating voltages, 1.0, 1.1, 1.2, 3.3, etc. Don't know what the efficiency of those chips is, but it's pretty elegant, particularly that a simple 5V supply is all that's needed at the top level.

Joe
Logged

jmknapp
Newbie
*

Karma: 0
Posts: 45



View Profile
« Reply #5 on: May 12, 2009, 03:45:24 AM »

This is coherent with what I measured with a basic killawatt:

I have a killawatt-type device (from La Crosse http://www.amazon.com/Crosse-Technology-3362U-Power-Controller/dp/B0000CDD37) that I noticed doesn't do a good job with rapidly-varying power changes such as with cpuidle. I think it was tending to read peak power over the scale of tens of milliseconds & so was always displaying the maximum power as the cpu wakes up pretty frequently with the orion_tick. Also, its resolution is 1-watt steps.  Looks like the killawatt might do a better job.

Joe
Logged

karurosu
Global Moderator
Full Member
*****

Karma: 0
Posts: 116



View Profile WWW
« Reply #6 on: May 19, 2009, 07:57:33 PM »

What kernel config did you use?
I applied the cpuidle patch to a vanilla sources 2.6.30-rc6 and compiled with cpuidle, however when running powertop I get the following:

< Detailed C-state information is only available on Mobile CPUs (laptops) >

What can I do to enable that information?

Thanks.
Logged

Rabeeh Khoury
Administrator
Full Member
*****

Karma: 5
Posts: 218


View Profile
« Reply #7 on: May 19, 2009, 10:27:10 PM »

You should have the following in your .config file -

#
# CPU Power Management
#
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y
Logged

karurosu
Global Moderator
Full Member
*****

Karma: 0
Posts: 116



View Profile WWW
« Reply #8 on: May 19, 2009, 10:47:31 PM »

Thanks, I just checked and I have those options enabled, and still I cant get the information on the C-state.
Logged

jmknapp
Newbie
*

Karma: 0
Posts: 45



View Profile
« Reply #9 on: May 20, 2009, 03:41:21 AM »

I used the Marvell git branch for 2.6.30-rc3 & don't recall having to do anything special. I.e., after installing the git package:

# git clone git://git.marvell.com/orion.git

That gets the latest from Marvell.

I installed the cross-compiling tools from codesourcery:

http://www.codesourcery.com/sgpp (Sourcery g++)

Then it's the usual:

# make ARCH=arm mrproper
# make ARCH=arm kirkwood_defconfig
# make ARCH=arm menuconfig
# make -j1 ARCH=arm CROSS_COMPILE=/usr/local/bin/codesourcery/bin/arm-none-linux-gnueabi- uImage

When the kernel is booting you should see these messages on the console:

cpuidle: using governor ladder
cpuidle: using governor menu

Just in case I'm forgetting some config option that has to be made, for reference I attached a copy of the .config file I built with.

Joe

P.S. The powertop FAQ lists some recommended kernel config settings: http://www.lesswatts.org/projects/powertop/faq.php







* config.zip (10.71 KB - downloaded 261 times.)
« Last Edit: May 20, 2009, 03:52:21 AM by jmknapp » Logged

karurosu
Global Moderator
Full Member
*****

Karma: 0
Posts: 116



View Profile WWW
« Reply #10 on: May 24, 2009, 10:51:34 PM »

Solved it by installing powertop 1.11

This is my information:
Cn                Avg residency       P-states (frequencies)
C0 (cpu running)        ( 2.1%)
C0                4.1ms (40.0%)
C1               10.0ms (57.9%)
Logged

Pages: [1]
Print
Jump to: