# kernel 2.6.32: power consumption way higher

## Thesee

Dear all,

I have been using kernel 2.6.28 for a long time now. I wanted to give a try to the 2.6.32.

Except the fact that CPU scaling does not really work (only one of the CPU can be scaled with cpufreqd), the power consumption has increased a _lot_ compared to 2.6.28.

I have the exact same configuration hardware (obvious as it is a laptop) and software wise. I just swap kernels at boot.

I tried also to keep the same options built-in and modules (except for lib80211). So I can fairly say that it is about the same thing.

With 2.6.28 and power optimisation, meaning xfce-power-manager and another few options, I can easily reach between 3 and 4 hours of basic usage.

With 2.6.32 with same optimisations, and actually less work on it (meaning just running without me actually working on it), I hardly manage 2h!

When I run powertop, it tells me that the consumpotion with 2.6.32 reaches around 34.1 W when idle and with 2.6.28, I hardly make it above 22 W...

So my questions are:

- has this behaviour been seen by others?

- are there specific options for power management that are in 2.6.32 and that were not in 2.6.28 that could explain this? (I didn't see any...)

- is it possible that the fact that CPU scaling is broken makes such a big difference?

- others?  :Smile: 

Thanks for your feedback!

----------

## bastibasti

I'll give it a try on my desktop (external power measurement) over the weekend. 

Can you check, which cpufreq driver is used on your two kernels?

----------

## Thesee

Sorry to sound noob, but how can I check the cpufreq driver version?

I checked in the menuconfig and couldn't find it. I also checked in drivers/cpufreq and in include/linux/cpufreq.h but I didn't see a version number there.

----------

## anomaly66

Hi, have same issue with perfectly running p4 server (prescott chips, under .28 they lope along 90% of the day at 350Mhz, under .30+ I get a "conservative governor failed, too long transition latency of HW, fallback to performance governor" error)

```

 cpufreq-info                                       

cpufrequtils 005: cpufreq-info (C) Dominik Brodowski 2004-2006        

Report errors and bugs to cpufreq@vger.kernel.org, please.            

analyzing CPU 0:

  driver: p4-clockmod

  CPUs which need to switch frequency at the same time: 0 2

  hardware limits: 400 MHz - 3.20 GHz

  available frequency steps: 350 MHz, 700 MHz, 1.05 GHz, 1.40 GHz, 1.75 GHz, 2.10 GHz, 2.45 GHz, 2.80 GHz

  available cpufreq governors: conservative, ondemand, powersave, userspace, performance

  current policy: frequency should be within 1.05 GHz and 1.05 GHz.

                  The governor "powersave" may decide which speed to use

                  within this range.

```

----------

## ToeiRei

I was following the kernel changelogs for a while. They disabled some powersaving features as they didn't work. Maybe that's the reason for the high power consumption?

----------

## pilla

 *ToeiRei wrote:*   

> I was following the kernel changelogs for a while. They disabled some powersaving features as they didn't work. Maybe that's the reason for the high power consumption?

 

If they didn't work, then this version should have the same power consumption. I suppose that they didn't work in some cases though. I have also noticed an increase on power consumption in my core 2 duo notebook.

----------

## toralf

With the ondemand governor I use this for my x86 Core2 Duo ThinkPad (/etc/conf.d/local.start) :

```

echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load

iwconfig wlan0 power on

ethtool -s eth0 wol d

echo 1500 > /proc/sys/vm/dirty_writeback_centisecs

```

Furthermore I've these kernel settings :

```
tfoerste@n22 ~ $ zgrep SAVE /proc/config.gz  | grep -v '#'

CONFIG_CPU_FREQ_GOV_POWERSAVE=m

CONFIG_SND_HDA_POWER_SAVE=y

CONFIG_SND_HDA_POWER_SAVE_DEFAULT=60

```

----------

## Dairinin

I remember acpi-cpufreq module stopped autoloading at one point, so now I have to have it loaded by rc system.

----------

## toralf

 *Dairinin wrote:*   

> I remember acpi-cpufreq module stopped autoloading at one point, so now I have to have it loaded by rc system.

 Yes, right :

```
tfoerste@n22 ~ $ grep acpi-cpufreq /etc/modules.autoload.d/kernel-2.6

acpi-cpufreq

```

however beside this module and "fbcon" all other modules ate loaded by udev & friends at my systems automatically.

----------

## Thesee

 *toralf wrote:*   

> With the ondemand governor I use this for my x86 Core2 Duo ThinkPad (/etc/conf.d/local.start) :
> 
> ```
> 
> echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load
> ...

 

Ok, how come you have 1 "/sys/devices/system/cpu/" for both of your cores while I have cpu0 and cpu1?

I tried your setting, but it didn't seem to have a big effect... and actually returned me this in the logs: CPUFREQ: Per core ondemand sysfs interface is deprecated - ignore_nice_load. So that would mean that I have a deprecated sysfs interface (even though I don't know what sysfs they talk about  :Smile: ).

I have acpi-cpufreq loaded as a module (before, it was compiled in) and all the governors are built in as well.

But really, you think that this 40-50% increase (from ~20W to ~30W based on powertop) is due to the cpu not scaling properly?

I mean, if I can trust this pie chart (http://webworkerdaily.com/2009/01/09/extending-your-laptops-battery-life-revisited/), the processor is just 8% of the complete consumption of a laptop...

How can I investigate this any further?

----------

## toralf

 *Thesee wrote:*   

> 
> 
> Ok, how come you have 1 "/sys/devices/system/cpu/" for both of your cores while I have cpu0 and cpu1?
> 
> 

 With a current kernel this is the shortcut to set both values at once : /sys/devices/system/cpu/cpu[01]/cpufreq/ondemand/ignore_nice_load.

----------

## Thesee

 *toralf wrote:*   

> With a current kernel this is the shortcut to set both values at once : /sys/devices/system/cpu/cpu[01]/cpufreq/ondemand/ignore_nice_load.

 

So I assume with kernel 2.6.33 (I'm using 2.6.32-tuxonice-r1 at the moment).

And is the cpufreq ondemand / conservative working for you with that kernel? (I'm still hoping to move further than 2.6.28 one day  :Very Happy: )

----------

## toralf

 *Thesee wrote:*   

>  *toralf wrote:*   With a current kernel this is the shortcut to set both values at once : /sys/devices/system/cpu/cpu[01]/cpufreq/ondemand/ignore_nice_load. 
> 
> So I assume with kernel 2.6.33 (I'm using 2.6.32-tuxonice-r1 at the moment).
> 
> And is the cpufreq ondemand / conservative working for you with that kernel? (I'm still hoping to move further than 2.6.28 one day )

 Oh no - I run a straight vanilla 2.6.32.5 kernel with ondemand governor.

----------

## Thesee

Just to come back on this...

After trying the new kernel 2.6.33, the problem remains.

Any idea on how to trace down why a change in kernel version increases my power consumption of about 40-50%?

----------

## Hwoarang

Same behavior on my laptop. Ondemand governor stopped working when I moved to 2.6.33  :Sad: 

----------

## asturm

Now that you say it, mine stopped working properly too. "ondemand" never goes below 1.6 GHz on my Thinkpad, 2.6.33-zen2 here. Are you guys using vanilla kernels?

----------

## Hwoarang

Im using zen-sources but I expect same behavior with gentoo-sources as well. I am downgrading to 2.6.32 and see how that  will go

----------

## asturm

I upgraded to 2.6.34-rc3-zen1 and there it works again.  :Wink: 

Things I changed:

```
-# CONFIG_CPU_FREQ_STAT is not set

+CONFIG_CPU_FREQ_STAT=y

+# CONFIG_CPU_FREQ_STAT_DETAILS is not set

-CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y

-# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set

+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set

+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y

-CONFIG_CPU_FREQ_GOV_PERFORMANCE=m

-CONFIG_CPU_FREQ_GOV_POWERSAVE=m

+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

+CONFIG_CPU_FREQ_GOV_POWERSAVE=y

-CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

 # CPUFreq processor drivers

-# CONFIG_X86_PCC_CPUFREQ is not set

+CONFIG_X86_PCC_CPUFREQ=y
```

Oh well, so I'm using a git kernel again. And I really thought I could finally stay comfortable with 33, at least for some time.  :Laughing: 

----------

## Hwoarang

Good news. The fact that works with 2.6.34 again is very promising. I really hope they will backport the patch to the next 2.6.33 release. But till then I will stick with the 2.6.32_zen6

----------

## kernelOfTruth

 *genstorm wrote:*   

> I upgraded to 2.6.34-rc3-zen1 and there it works again. 
> 
> Things I changed:
> 
> ```
> ...

 

*subscribes*

thanks for that information, genstorm !

I'll counter-check my configuration against yours whether I have anything left out

how goes the saying: once bleeding edge - always bleeding edge ?   :Wink: 

----------

## pigeon768

 *genstorm wrote:*   

> Oh well, so I'm using a git kernel again. And I really thought I could finally stay comfortable with 33, at least for some time. 

  I say that to myself every kernel version.  :Embarassed: 

----------

## asturm

 *kernelOfTruth wrote:*   

> how goes the saying: once bleeding edge - always bleeding edge ?  

 

You're so right  :Laughing: 

Btw, someone could also back-tick those options into a 33 .config in case this is only a configuration issue. I won't, since I happen to be quite satisfied with 34-rc3-zen1. No issues so far and a damn quiet dmesg log.

----------

## dmpogo

 *ToeiRei wrote:*   

> I was following the kernel changelogs for a while. They disabled some powersaving features as they didn't work. Maybe that's the reason for the high power consumption?

 

Do you remember, starting from what version ?

----------

## Gentoo4Work

Maybe that's related to what I've been seeing.  I'm using gentoo-sources 2.6.33, with performance as the governor.  I don't know if it's KDE that's wrong, but even very large emerges aren't doing much with the CPU's... they sat there clocked at 1.6 - 2.0 GHz., and about 20% utilization while doing 'emerge netbeans'.  For CPU's rated at 2.93 GHz, that seems a bit off... and I'm pretty sure that speedstep is disabled in the BIOS   :Confused: 

----------

## ToeiRei

 *dmpogo wrote:*   

>  *ToeiRei wrote:*   I was following the kernel changelogs for a while. They disabled some powersaving features as they didn't work. Maybe that's the reason for the high power consumption? 
> 
> Do you remember, starting from what version ?

 

It was at .20 if I remember that correctly when they had to disable some functions per default.

----------

## asturm

Just so you know: I git pulled zen-stable before and after rebooting into the new kernel, the ondemand governor at last clocks down to 800 Mhz - but never above 1.6 GHz, when it actually should go for 1.87  :Laughing: 

EDIT: Hm. Actually, no. It seems it would work at first, moving clock speed between 800 and 1600 MHz (never above), but after some time, just stops and always stays at 1.6 GHz.

Also, this looks strange:

```
cpufreq stats: 1.87 GHz:0,00%, 1.87 GHz:0,00%, 1.60 GHz:37,13%, 800 MHz:62,87%  (5339)
```

Seems to mis-detect available frequency steps.

(2.6.34 broke EDID handling for my external Displayport so I have to use 2.6.33 when on the docking station)

Now, 2.6.34 shows similar behaviour at first. I might have given wrong info about that topic...

----------

## asturm

Now, only with a 2.6.32 kernel does my system use the full range of 800 MHz to 1867 MHz, even though I still see that doubled 1.87 GHz P-State while I think there should be another one between 1.6 and 0.8...

----------

## Hwoarang

Upgraded to 2.6.33-zen2 and still having the same problem. Does anybody know where the patch is so I can apply it to zen-sources and/or if this bug is reported on kernel bugzilla?

----------

## asturm

When did you upgrade? Yesterday I git pulled again to get the 2.6.33.3 release merged into zen-stable, and finally the CPU is running its full range of P-States.

----------

## Hwoarang

Yesterday. The new 2.6.33_p2 zen-sources ebuild.

Could this patch http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=patch;h=499bca9b6d3243f9278a1f5a22d00e67acdd844d fix the problem?

----------

## Hwoarang

This is the actual log from kernel lock

 *Quote:*   

> [   20.899822] [ INFO: possible recursive locking detected ]
> 
> [   20.901240] 2.6.33-zen2-night-elf #1
> 
> [   20.902660] ---------------------------------------------
> ...

 

----------

## Hwoarang

and this is the upstream bug report

https://bugzilla.kernel.org/show_bug.cgi?id=15264

----------

## asturm

Ok, cpufreq showing old behavior again  :Rolling Eyes:  - I'll also rebuild the kernel with debug locks.

I have no idea what is triggering this - sometimes, it works for hours, now it didn't work right from the start. Only thing I could see in dmesg now was the following, some time after the last init msg:

```
[  301.777804] CPUFREQ: Per core ondemand sysfs interface is deprecated - up_threshold
```

----------

## asturm

Switching on lock debugging turns my kernel into a complete mess  :Rolling Eyes: 

dmesg gets spammed to death with mini panics, system wouldn't even boot... I don't have time for that right now, unfortunately.

----------

## Hwoarang

I switched from cpufreqd to cpufrequtils and everything works fine  :Smile: 

----------

## asturm

I'm running cpufrequtils all the time...  :Sad: 

----------

## Hwoarang

 *genstorm wrote:*   

> When did you upgrade? Yesterday I git pulled again to get the 2.6.33.3 release merged into zen-stable, and finally the CPU is running its full range of P-States.

 

I am confused. Does it or it doesn't work for you?

----------

## asturm

I thought I wrote that already. One time, it works - then again, it doesn't. So, in sum, it doesn't.

I have no clue what is influencing this weird behavior.

Currently in 2.6.34_rc6 again:

Calculating the faculty of 1 000 000 000 one core cranks up - but stops only at 1.6GHz. It never goes above:

cpufreq stats: 1.87 GHz:0,00%, 1.87 GHz:0,00%, 1.60 GHz:21,31%, 800 MHz:78,69%  (64330)

Next boot, it could be different again.

EDIT: And it was different. Uptime now over 11h since rebooting yesterday, and the CPU again/still clocks between 0.8 and 1.87 GHz, using its full range. So, the issue is occurring at boot time?

----------

