Terminus Logo

Question ? How does CPU Frequency scaling, e.g. powersaving work ?  

 The Epia SP8000E uses a 800MHz Nemiah core CPU. By loading the longhaul module - you can throttle the CPU (Tested with 2.6.11.6). Please note that there are many patches to the cpufrequency control - and many are unstable. If your System locks-Hard - you have a bad implementation :)
So - all you need to do is enable the cpu frequency scaling by loading the longhaul module and some governors:

 modprobe longhaul
 modprobe cpufreq_powersave

Check using the dmesg command to see if it loaded correctly.
If this works - make sure the longhaul module gets loaded at every boot. For this - just add longhaul and cpufreq_powersave into the /etc/modprobe.preload file.
Using longhaul - make sure your kernel was configured with the userspace-governor enabled by default - then change to:

root # cd /sys/devices/system/cpu/cpu0/cpufreq/
cpufreq # ls 
affected_ cpuinfo_cur_freq
cpuinfo_max_freq
cpuinfo_min_freq
scaling_available_frequencies
scaling_available_governors
scaling_cur_freq
scaling_driver
scaling_governor
scaling_max_freq
scaling_min_freq
scaling_setspeed
cpufreq # cat scaling_cur_freq
798000
cpufreq # cat scaling_available_frequencies
532000 598000 731000 798000 665000
cpufreq # echo 532000 > scaling_setspeed
cpufreq # cat scaling_cur_freq
532000

With the userspace governor activated

cpufreq # cat scaling_available_governors
userspace

The System will set the speed up to 800MHz in this special case - if required - and when idle again - go down with the frequency. In short - it will dynamically monitor the system load and regulate the CPU Frequency accordingly. If you want to stick the system into powersave mode - load the cpufreq_powersave.ko module

cpufreq # modprobe cpufreq_powersave
cpufreq # cat scaling_available_governors
powersave userspace
echo powersave > scaling_governor

This will make the CPU-Frequency sticky at the lowest speed your CPU can run at - and hopefully lower the overall system power consumption and heat dissipation This is what I have added to the system's /etc/rc.local file on my server - so it gets activated at every boot.

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

For those having a RedHat based system - you can use the following startup-script cpufreq.tar.gz. 2 Files are in there:

/etc/init.d/cpufreq
/etc/sysconfig/cpufreq

Edit the /etc/sysconfig/cpufreq and set your preferences - then:

init.d # ./cpufreq status
CPU Frequency Scaling deactivated !
stargate init.d # ./cpufreq start
Loading modules: longhaul, cpufreq_powersave
Setting gowernor to: powersave
Actual powerstatus: longhaul(powersave) @ 399000KHz

If this works - register it to the underlaying system issuing:

chkconfig --add cpufreq
chkconfig --list cpufreq
cpufreq         0:off   1:off   2:on    3:on    4:on    5:on    6:off

This will start the script at every startup.
Note that you can start the exact order by adapting the chkconfig-line in the init.d/cpufreq script itself. It is set to be started after udev and iptables startup.

# chkconfig: 2345 05 90

If chkconfig does not exist on your system - you can of course create symlinks - as back in old times. 

Entered by smurphy on Friday, 02 September 2005 @ 23:33:37  
Linux on VIA Epia Hardware - Epia SP8000E, # Hits: 91560

Attach   cpufreq.tar.gz  [ 1,014 bytes - application/x-gzip ]

This page was issued from the Terminus Website:
https://www.solsys.org

The URL for this page is:
https://www.solsys.org/mod.php?mod=faq&op=view&faq_id=81


  Close