# CPU Throttling => I don't get it

## jayson

Hello!

Configured my kernel and installed powersave, because I want be able to optimize my notebook for optimal energy use.

Kernel works perfect, powersave emerged with no problems ok

Let's throttle the cpu and watch if the cpu frequency changes:

//tty1

jaylab jay # watch -n 4 powersave -r

//tty2

jaylab jay # powersave -p50

 *Quote:*   

> CPU 0:
> 
> Throttling states : 8
> 
> Current state: 4
> ...

 

Ok. But the output of powersave -r doesn't change! I always get 1997.352051 MHz although I should get ~1000MHz (as I throttled my cpu frequency by 50%)

Hmm ... maybe powersave -r is wrong. So let's use cpufreq-info.

cpufreq-info tells me ...

 *Quote:*   

> cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006
> 
> Report errors and bugs to linux@brodo.de, please.
> 
> analyzing CPU 0:
> ...

 

... that my cpu frequency is 1Ghz as it should.

So let's change it again

powersave -p30

cpufreq-info

 *Quote:*   

> same output as above 1GHz

 

My question is know. What did I do wrong? I don't get any errors and throtteling seems to work ... and is enabled in the kernel.

Thank you for any help!

Best Regards Jacob

----------

## bLUEbYTE84

Which type of cpu do you have? Pentium-M?

I have a pentium-m and you absolutely DON'T need a demon whatsoever.

Begin with forgetting about that daemon and unmerge it.

Be sure that you activated the CPU Freq. scaling options, any option for your specific CPU if applicable, and the governors in your kernel.

Then, you set the governor like this:

echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

OR

echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

OR

echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

I get the idea, right?

The default is the performance governor.

I have echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor line in my /etc/conf.d/local.start so it is effective at each boot.

Hope this help. Post if you need more info.

----------

## jserink

Hi There:

Not sure which CPU you're using but Mine is an athlon XPM 2500. Loading cpufreq_powersave as the governor simply sets the CPU to the lowest frequency possible, that's it. Similarly, loading the cpufreq_performance governor sets it to the highest freq possible. if you want dynamic control, you have trhee choices:

1. userspace governor,

2. Ondemand goernor,

3. Conservative governor.

userspace means you set the frequency yourself by setting the appropriate level for the values in /sys/devices/system/cpu/cpu0/cpufreq directory. I recommend rummaging around in that area to get comfortable, look at the settings using cat, you can change settings using echo. You can also use the cpufreq-set command to manipulate things.

Note: Whatever governor is presently being used, the minute you try and set the frequecy manually using cpufreq-set the governor iwl automatically change to userspace. 

While userspace is interesting you will quickly get bored with the tedious business of always having to fiddle with the settings.

Ondemand governor toggles you between min freq and max freq depending upon load. 

Conservative is much like on demand but moves is steps up and then steps down, depending up CPU loading.

This is all in the kernel docs.

I use the cpufreq_conservative governor and it works excellent. I have to do a small mod to the souce code to get it to work the way I wanted to on my Athlon but it works great now, I need not touch it.

You might have too many things loaded up. if you want to use the kernel governors, the stuff I described here, you do not need cpufreqd, cpudyn, speed freq, etc...

Cheers,

John

----------

## jayson

First of all, thanks for your replys!

I have a core duo T2500 @ 2GHz.

@jserink

Thank you for your help. I really appreciate that, but I think that this solution is probably a bit (or a lot  :Smile: ) too advanced for me, as I am a Linux newbie  :Smile:  and you probably a professional!

Although I am pretty high skilled in PHP and Java I have no clue of C ... and kernel programming ... 

@bLUEbYTE84

I activated all (for me) relevant options when compiling the kernel.

 *Quote:*   

> Post if you need more info.

 

That would be very nice!! Thanks a lot!

I really appreciate your help as power management is very very important for me!

Best Regards Jay

----------

## tom_bxl

Have you tried user friendly tools such as the gnome cpu frequency applet (there's probably an equivalent in KDE)? You can change the governors from there with a right-click (without any daemons).

Tom

----------

## bLUEbYTE84

 *jayson wrote:*   

> First of all, thanks for your replys!
> 
> too advanced for me, as I am a Linux newbie 
> 
> Although I am pretty high skilled in PHP and Java I have no clue of C ... and kernel programming ... 
> ...

 

No need to worry, you probably won't need to go that far  :Wink: 

Hmmm, unfortunately as far as I know there is no support for freq. scaling for those processors yet. At least in the kernel context.

You might be able to get it working by using user-space daemons.

Therefore, maybe someone else should comment on this since I don't have a core duo. 

Good luck

 *Quote:*   

> 
> 
> Have you tried user friendly tools such as the gnome cpu frequency applet (there's probably an equivalent in KDE)? You can change the governors from there with a right-click (without any daemons).
> 
> 

 

In order to make those tools function, you need the freq. scaling support in the first place. Therefore, that's not a solution.

----------

## tom_bxl

 *Quote:*   

> 
> 
> In order to make those tools function, you need the freq. scaling support in the first place. Therefore, that's not a solution.
> 
> 

 

Well, if one sees the /sys/device/.../cpufreq/scaling_governor files, in order to be able to "echo something > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor". I would assume (but maybe I'm very wrong   :Smile:  ) that cpu frequency scaling is available. These little tools are just another way of doing the same thing.

----------

## jayson

Frequency scaling also worked with openSuse 10.2, but there i did this via yast.

...

Best Regards Jay

----------

## bLUEbYTE84

 *tom_bxl wrote:*   

>  *Quote:*   
> 
> In order to make those tools function, you need the freq. scaling support in the first place. Therefore, that's not a solution.
> 
>  
> ...

 

True, but does he have them? That's the question  :Smile:  Unless I'm missing something, he haven't mentioned.

OP: Please check if you have /sys/devices/system/cpu/cpu0/cpufreq directory.

----------

## jayson

Yeah. I got this directories and I also got the scaling_governor and tried using them (setting powersave for each cpu), but the cpu frequency stayed the same and nothing changed. so it doesn't work.

best regards jay

----------

## jserink

 *jayson wrote:*   

> Yeah. I got this directories and I also got the scaling_governor and tried using them (setting powersave for each cpu), but the cpu frequency stayed the same and nothing changed. so it doesn't work.
> 
> best regards jay

 

Jay!

Read what you just wrote above and then re-read my post.

You might also want to read where I got the info from...

/usr/src/linux/Documentation/cpu-freq....its all in there in VERY simple text files.

If the CPU frequency is at its lowest and statying there, then its all working as you're using the cpufreq_powersave governor.

if you don't want it low all the time, use a different governor.

Cheers,

john

----------

## bLUEbYTE84

Those two people were experiencing what I see as exact same issue as yours, and it was solved. Therefore I recommend you to check your kernel config once again, very carefully, and building stuff built-in.

https://forums.gentoo.org/viewtopic-t-531511-highlight-.html

----------

