[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How does one control fans?



> > and tell the kernel to use the ondemand governor for frequency scaling:
> > # echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
>
> My problem is that /cpufreq/scaling_governor doesn't appear until after
> I do:
> # modprobe acpi_cpufreq
> Is that correct?

I am not sure about that one. I don't have this module loaded (even gives a
"busy" error when modprobing it) and still have the /cpufreq/scaling_governor
available. But I am on the AMD64 kernel, which might be different from x86.

> > (you will have to do that every time you boot, so add a script to your
> > runlevel)
>
> What? And miss out on all that typing?

If you don't compile your own kernel, you are stuck with the options the 
Debian default kernel uses. This means, it will use the "performance" governor
as default governor. So I wrote a small script, which I put into /etc/init.d
and link into runlevel 2, to select the "ondemand" governor, e.g.:
______________________________________________
#! /bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=cpufreq_ondemand
DESC=cpufreq_ondemand

case "$1" in
  start)
        echo -n "Starting $DESC: "
        echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
        echo "$NAME started."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
        echo "$NAME stopped."
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop}" >&2
        exit 1
        ;;
esac

exit 0
______________________________________________



Reply to: