Jump to content
XPEnology Community
  • 0

cpufreq and powernow-k8 modules


neverstopdreaming

Question

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

Link to comment
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
Link to comment
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.

Link to comment
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:

Link to comment
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:

Link to comment
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:

Link to comment
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

Link to comment
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.

Link to comment
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:

Link to comment
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
Link to comment
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:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...