• 0
neverstopdreaming

cpufreq and powernow-k8 modules

Question

Hi Sancome,

would you add powernow-k8 module and cpufreq-utils or cpupower utilties in the next build?

It would be fine to limit CPU power when unused also on AMD cpu. In kernel 3.2 acpi-cpufreq module is not able to handle AMD cpu yet.

 

thanks

Neverstopdreaming

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

Hi Sancome,

thanks for the new version! XPEnoboot_DS3615xs_5.1-5022.3 works fine for AMD CPU:

 

[  168.210238] powernow-k8: Found 1 AMD E-350 Processor (2 cpu cores) (version 2.20.00)
[  168.210311] powernow-k8:    0 : pstate 0 (1600 MHz)
[  168.210315] powernow-k8:    1 : pstate 1 (1280 MHz)
[  168.210318] powernow-k8:    2 : pstate 2 (800 MHz)

 

I just needed to load the module and change the governor to ondemand:

insmod /lib/modules/powernow-k8.ko
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

 grep "MHz" /proc/cpuinfo 
cpu MHz         : 800.000
cpu MHz         : 800.000

 

Can you suggest where should I put them to load on boot? Some /etc/init/rc.* should be fine?

 

thanks

Share this post


Link to post
Share on other sites
  • 0

Thanks neverstopdreaming .

Can you tell how you get the first step?

Or better what you do exactly?

 

I really want to have the PowerSaving.

 

withwolf1987

Share this post


Link to post
Share on other sites
  • 0

Maybe "conservative" governor is better for nas? In FreeNAS it's default governor. I have switched from ondemand, cpu now sit with lowest frequencies, occasionally switch to higher ones. With ondemand it jumps from min to max frequency, ommiting middle cpu states.

Edited by Guest

Share this post


Link to post
Share on other sites
  • 0
Thanks neverstopdreaming .

Can you tell how you get the first step?

Or better what you do exactly?

 

Just execute the insmod.. command.

Then you can see with "dmesg" command if the module identifies you CPU.

 

the echo commands are necessary to change the CPU governor for each CPU (core) you have.

Share this post


Link to post
Share on other sites
  • 0
Maybe "conservative" governor is better for nas? In FreeNAS it's default governor. I have switched from ondemand, cpu now sit with lowest frequencies, occasionally switch to higher ones. Witch ondemand it jumps from min to max frequency, ommiting middle cpu states.

 

You're right, it should be better. There is no need to quick spikes.

Share this post


Link to post
Share on other sites
  • 0

u can put the script file into the /usr/local/etc/rc.d/ directory.

the filename like this "S99Powersaving.sh"

Share this post


Link to post
Share on other sites
  • 0
u can put the script file into the /usr/local/etc/rc.d/ directory.

the filename like this "S99Powersaving.sh"

 

For the people who don't know exactly how to do this....

 

The contents of the file should look something like this:

 

#!/bin/sh

echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

 

It can be simply made with a text editor.

 

 

Above is how I did it and it works, finally I don't have to do it by hand anymore every time the server is rebooted. :cool:

Share this post


Link to post
Share on other sites
  • 0

I'm running 5022.3 on a C1037U and it seems like it always goes back to performance profile after about an hour. Short of running the script every hour is there another fix?

Share this post


Link to post
Share on other sites
  • 0

Yes, I made a script to check what governor is set and change it back to conservative. It runs from crontab every ten minute.

 

Tapnięte z lenovo a820

Share this post


Link to post
Share on other sites
  • 0
Yes, I made a script to check what governor is set and change it back to conservative. It runs from crontab every ten minute.

sszpila, do you mind sharing your script?

 

Thanks.

Share this post


Link to post
Share on other sites
  • 0

Sure :smile:

#!/bin/sh

for c in $(ls -d /sys/devices/system/cpu/cpu[0-9]*);
do if ! grep -q 'conservative' $c/cpufreq/scaling_governor ;
   then echo conservative >$c/cpufreq/scaling_governor ;
fi
done

 

Script i fired on every ten minutes by cron.

Share this post


Link to post
Share on other sites
  • 0

This is simply just great! Now my N54L is almost hybernating... :grin:

NAS8> grep "MHz" /proc/cpuinfo
cpu MHz         : 2196.380
cpu MHz         : 2196.380
NAS8> insmod /lib/modules/powernow-k8.ko
NAS8> dmesg|grep powernow
[   98.393259] powernow-k8: Found 1 AMD Turion(tm) II Neo N54L Dual-Core Processor (2 cpu cores) (version 2.20.00)
[   98.393303] powernow-k8:    0 : pstate 0 (2200 MHz)
[   98.393305] powernow-k8:    1 : pstate 1 (1900 MHz)
[   98.393307] powernow-k8:    2 : pstate 2 (1600 MHz)
[   98.393308] powernow-k8:    3 : pstate 3 (1300 MHz)
[   98.393310] powernow-k8:    4 : pstate 4 (800 MHz)
NAS8> echo conservative  > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
NAS8> echo conservative  > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
NAS8> grep "MHz" /proc/cpuinfo
cpu MHz         : 800.000
cpu MHz         : 800.000

Thanks sancome! :grin:

Share this post


Link to post
Share on other sites
  • 0
u can put the script file into the /usr/local/etc/rc.d/ directory.

the filename like this "S99Powersaving.sh"

 

For the people who don't know exactly how to do this....

 

The contents of the file should look something like this:

 

#!/bin/sh

echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

 

It can be simply made with a text editor.

 

 

Above is how I did it and it works, finally I don't have to do it by hand anymore every time the server is rebooted. :cool:

 

What about the "insmod" command? shouldnt it be in the script too? or is there a better place to put that into?

(Sorry to ask, iam a linux newbie) :smile:

Share this post


Link to post
Share on other sites
  • 0

thanks for the info, did the same and it seems to work fine for me now, too

 

thanks for your help

Share this post


Link to post
Share on other sites
  • 0
Sure :smile:

#!/bin/sh

for c in $(ls -d /sys/devices/system/cpu/cpu[0-9]*);
do if ! grep -q 'conservative' $c/cpufreq/scaling_governor ;
   then echo conservative >$c/cpufreq/scaling_governor ;
fi
done

 

Script i fired on every ten minutes by cron.

Thanks sszpila. Hmm, not sure if the cron daemon is finicky cos after some time it still reverts :sad:

 

*/15        *        *        *        *        root        /volume1/share/powersaving.sh

Share this post


Link to post
Share on other sites
  • 0

Tankowiec> cpufreq-info
cpufrequtils 006: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
 driver: powernow-k8
 CPUs which run at the same hardware frequency: 0
 CPUs which need to have their frequency coordinated by software: 0
 maximum transition latency: 8.0 us.
 hardware limits: 800 MHz - 2.20 GHz
 available frequency steps: 2.20 GHz, 1.90 GHz, 1.60 GHz, 1.30 GHz, 800 MHz
 available cpufreq governors: conservative, powersave, performance, ondemand, userspace
 current policy: frequency should be within 800 MHz and 2.20 GHz.
                 The governor "conservative" may decide which speed to use
                 within this range.
 current CPU frequency is 800 MHz (asserted by call to hardware).
 cpufreq stats: 2.20 GHz:0.29%, 1.90 GHz:0.59%, 1.60 GHz:1.68%, 1.30 GHz:2.56%, 800 MHz:94.88%  (317669)
analyzing CPU 1:
 driver: powernow-k8
 CPUs which run at the same hardware frequency: 1
 CPUs which need to have their frequency coordinated by software: 1
 maximum transition latency: 8.0 us.
 hardware limits: 800 MHz - 2.20 GHz
 available frequency steps: 2.20 GHz, 1.90 GHz, 1.60 GHz, 1.30 GHz, 800 MHz
 available cpufreq governors: conservative, powersave, performance, ondemand, userspace
 current policy: frequency should be within 800 MHz and 2.20 GHz.
                 The governor "conservative" may decide which speed to use
                 within this range.
 current CPU frequency is 800 MHz (asserted by call to hardware).
 cpufreq stats: 2.20 GHz:0.06%, 1.90 GHz:0.07%, 1.60 GHz:0.08%, 1.30 GHz:0.16%, 800 MHz:99.63%  (13669)
Tankowiec>

 

As you see, my cpus are sitting at lowest frequency for most of time. Even if governors were revert to performance, for max 10 minutes they will back to conservative. I noticed that wake disks from hibernation changes governor to performance.

Share this post


Link to post
Share on other sites
  • 0

Hi everyone, I just can't get my head around what I need to do to get power saving working on my HP54L.

 

Could someone document a step by step idiots guide please?

 

Thanks for your help.

Share this post


Link to post
Share on other sites
  • 0

Which module I must load for an Intel-Cpu?

I have a HP Microserver Gen 8 with a Celeron G1610 CPU and get the error "no or unknown cpufreq driver is active on this CPU" if I run "cpufreq-info".

I am also not able to set the cpu governor as the entries under /sys/devices.... don't exists (this makes sense as the driver is not loaded).

Maybe someone can point me to the correct module to load. :smile:

Share this post


Link to post
Share on other sites
  • 0

I have the answer for the HP Microserver Gen8! :grin:

The trick is to set the power setting in the Bios to "OS controlled" (and don't forget to save this setting as "User-default". Otherwise it will be resetted at the next reboot caused by the "bios reset bug")

 

After the next boot all power-settings are accessible without loading any additional modules.

 

Thanks for the script to set the conservative governor at boot. It works very well! :smile:

Edited by Guest

Share this post


Link to post
Share on other sites
  • 0
u can put the script file into the /usr/local/etc/rc.d/ directory.

the filename like this "S99Powersaving.sh"

 

For the people who don't know exactly how to do this....

 

The contents of the file should look something like this:

 

#!/bin/sh

echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

 

It can be simply made with a text editor.

 

 

Above is how I did it and it works, finally I don't have to do it by hand anymore every time the server is rebooted. :cool:

 

What about the "insmod" command? shouldnt it be in the script too? or is there a better place to put that into?

(Sorry to ask, iam a linux newbie) :smile:

 

 

I have a Intel CPU and the scaling governor works fine already, so I don't need the 'insmod' command. In my case with above script it works perfectly, also after reboot, which was the part I never got to work properly. I always had to change the governor manually by executing a task with the same commands as in the script after a reboot and now I don't need to anymore which is great! :cool:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now