[ltp] Cpufreqd und cpufrequtils

Guarded Identity linux-thinkpad@linux-thinkpad.org
Fri, 24 Feb 2006 23:11:14 -0600


Hi,

I think one of the problems you're facing is that kernel's now offer internal 
governors (ondemand, conservative).  Before only userspace governors were 
available.  The internal governors aren't completely as flexible as userspace 
governors like powernowd, or cpufreqd, but I use the built in governors, and 
they work perfectly fine more me.  Honestly, most of the time, I'm just at 
600MHz, so it's not really that big a deal for me.  Ondemand just jumps 
really rapidly from min to max frequencies.  Conservative does a slower 
ramping.  You can control these governors a bit from the SysFS.  Here's a 
listing of what's there in my Thinkpad T42:

[ /sys/devices/system/cpu/cpu0/cpufreq]
$ ls -la
total 0
drwxr-xr-x  4 root root    0 2006-02-24 22:45 ./
drwxr-xr-x  3 root root    0 2006-02-24 08:33 ../
-r--r--r--  1 root root 4096 2006-02-24 22:45 affected_cpus
drwxr-xr-x  2 root root    0 2006-02-24 08:33 conservative/
-r--------  1 root root 4096 2006-02-24 22:45 cpuinfo_cur_freq
-r--r--r--  1 root root 4096 2006-02-24 22:45 cpuinfo_max_freq
-r--r--r--  1 root root 4096 2006-02-24 22:45 cpuinfo_min_freq
-r--r--r--  1 root root 4096 2006-02-24 22:45 scaling_available_frequencies
-r--r--r--  1 root root 4096 2006-02-24 22:45 scaling_available_governors
-r--r--r--  1 root root 4096 2006-02-24 22:45 scaling_cur_freq
-r--r--r--  1 root root 4096 2006-02-24 22:45 scaling_driver
-rw-r--r--  1 root root 4096 2006-02-24 08:33 scaling_governor
-rw-r--r--  1 root root 4096 2006-02-24 22:45 scaling_max_freq
-rw-r--r--  1 root root 4096 2006-02-24 22:45 scaling_min_freq
drwxr-xr-x  2 root root    0 2006-02-24 08:33 stats/

So really, you don't quite need cpufrequtils if you're okay just directly 
managing these files, but honestly, cpufrequtils makes it pretty easy.  

    sudo sh -c "echo conservative > \
        /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"

isn't quite as convenient as:

    sudo cpufreq-set -g conservative

Also, cpufrequtils will throw in a nice /etc/init.d/ script that helps set up 
the governor on boot-up.

If you do want to use cpufreqd, powernowd, or some other userspace governor, 
then you're going to set the governor in the kernel to "userspace."  It looks 
like you have all the governors available that I do compiled into your 
kernel:

[ /sys/devices/system/cpu/cpu0/cpufreq]
$ more scaling_available_governors 
conservative ondemand powersave userspace performance

Setting the governor to something like "ondemand" and also running cpufreqd 
will just be a waste of the cpufreqd daemon.  cpufreqd will only be in 
control if you set the kernel to use the "userspace" governor.

Anyway, that's what I know about SpeedStepping.  Hopefully it helps you sort 
things out.

- Sukant 

> Hello,
>
> i have a problem configuring my CPU-freq-scaling.
> I do have laptopmode, cpufreqd and cpufrequtils. laptopmode is added to
> battery runlevel, cpufeqd to default and battery and cpufrequtils to
> nothing.
>
> Do i need both, cpufreqd and utils ? What do i have to do to make
> speedstepping work. I can change frequency manually bei typing cpufreq-set
>
>
> denkbrett conf.d # cpufreq-info
> cpufrequtils 0.4: cpufreq-info (C) Dominik Brodowski 2004
> Report errors and bugs to linux@brodo.de, please.
> analyzing CPU 0:
>   driver: centrino
>   CPUs which need to switch frequency at the same time: 0
>   hardware limits: 800 MHz - 2.00 GHz
>   available frequency steps: 2.00 GHz, 1.60 GHz, 1.33 GHz, 1.07 GHz, 800
> MHz available cpufreq governors: conservative, ondemand, powersave,
> userspace, performance
>   current policy: frequency should be within 800 MHz and 800 MHz.
>                   The governor "ondemand" may decide which speed to use
>                   within this range.
>   current CPU frequency is 800 MHz (asserted by call to hardware).
>
> is the output in bash, /etc/cpufreqd.conf is set, governor "ondemand" is
> set in conf.d/cpufrequtils.
>
> Problems are: while compiling CPU is still on 800Mhz and when i cut ac,
> laptopmode is still disabled and no govenor is changed or freq.