Controlling CPU Frequency

Hi,
I rebooted my PC the other day, and only then I know that my CPU is overheated, because I saw a BIOS warning. The fact that my CPU might have been overheated for months made me consider seriously to control my CPU frequency (My AMD cpu has that feature available in bios).
I've tried to make use powernowd before, but never able to. I should feel lucky this time since the latest kernel that grml 1.0-1 uses, support cpu frequency control by default:
http://kernelnewbies.org/Linux_2_6_20 "Grand unification of ACPI based speedstep-centrino and acpi-cpufreq drivers. It combines functionality of these two driver into acpi-cpufreq driver."
But the problem is that googling "acpi-cpufreq" didn't come up much result. The closest is from http://bbs.archlinux.org/viewtopic.php?pid=256607
"... you should try the 'acpi-cpufreq' module. My favorite governor is the 'conservative' one. Under load, it will ramp up the frequency, but it will generally keep it as low as possible."
But there is no details. So I'm wondering if anyone can help me here?
thanks a lot!

* - Tong - mlist4suntong@yahoo.com [20070731 03:15]:
I rebooted my PC the other day, and only then I know that my CPU is overheated, because I saw a BIOS warning. The fact that my CPU might have been overheated for months made me consider seriously to control my CPU frequency (My AMD cpu has that feature available in bios).
What temperature was your CPU running at?
I've tried to make use powernowd before, but never able to. I should feel lucky this time since the latest kernel that grml 1.0-1 uses, support cpu frequency control by default:
http://kernelnewbies.org/Linux_2_6_20 "Grand unification of ACPI based speedstep-centrino and acpi-cpufreq drivers. It combines functionality of these two driver into acpi-cpufreq driver."
But the problem is that googling "acpi-cpufreq" didn't come up much result. The closest is from http://bbs.archlinux.org/viewtopic.php?pid=256607
"... you should try the 'acpi-cpufreq' module. My favorite governor is the 'conservative' one. Under load, it will ramp up the frequency, but it will generally keep it as low as possible."
But there is no details. So I'm wondering if anyone can help me here?
acpi-cpufreq is the kernel module used instead of speedstep-centrino with kernels >=2.6.20.
To check your current settings regarding cpu frequency scaling check output of 'cpufreq-info'. To configure your current settings (if you aren't happy with the defaults) either manually use sysfs or use the userspace tool cpufreq-set.
Is the 'thermal' kernel module loaded on your system? Check CPU temperature using tools like sensors/mbmon (depending of your hardware whether what's supported of course).
If you want to read some docs regarding ACPI and cpufreq start for example with https://www.linux-magazine.com/issue/40/ACPI.pdf and https://ols2006.108.redhat.com/2007/Reprints/brown_1-Reprint.pdf and the docs inside Documentation/cpu-freq/ of current kernel sources.
regards, -mika-

On Tue, 31 Jul 2007 08:47:32 +0200, Michael Prokop wrote:
If you want to read some docs regarding ACPI and cpufreq start for example with https://www.linux-magazine.com/issue/40/ACPI.pdf and https://ols2006.108.redhat.com/2007/Reprints/brown_1-Reprint.pdf and the docs inside Documentation/cpu-freq/ of current kernel sources.
Thanks for the info. Just finished reading them.
To check your current settings regarding cpu frequency scaling check output of 'cpufreq-info'...
% cpufreq-info cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006 Report errors and bugs to linux@brodo.de, please. analyzing CPU 0: no or unknown cpufreq driver is active on this CPU
,----- | If cpufreq quits with an error message, you should first re-check that you | have the correct cpufreq driver. `-----
So, what cpufreq driver should I use?
Is the 'thermal' kernel module loaded on your system?
% insmod thermal insmod: can't read 'thermal': No such file or directory
$ dmesg | grep ^CPU0 CPU0: AMD Athlon(tm) 64 Processor 2800+ stepping 0a
,----- | If you intend to use a kernel compiled with these features, you should use | dmesg | grep cpufreq to check if the kernel was able to initialize the | feature. `-----
% dmesg | grep cpufreq || echo no found no found
$ uname -rm 2.6.20-grml i686
Check CPU temperature using tools like sensors/mbmon (depending of your hardware whether what's supported of course).
How would I know if my hardware is supported or not?
BTW, anybody know the 'conservative' governor?
Thanks

* - Tong - mlist4suntong@yahoo.com [20070801 06:15]:
On Tue, 31 Jul 2007 08:47:32 +0200, Michael Prokop wrote:
To check your current settings regarding cpu frequency scaling check output of 'cpufreq-info'...
% cpufreq-info cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006 Report errors and bugs to linux@brodo.de, please. analyzing CPU 0: no or unknown cpufreq driver is active on this CPU
Ok, so you don't have any drivers loaded.
,----- | If cpufreq quits with an error message, you should first re-check that you | have the correct cpufreq driver. `-----
So, what cpufreq driver should I use?
See below.
Is the 'thermal' kernel module loaded on your system?
% insmod thermal insmod: can't read 'thermal': No such file or directory
# modprobe thermal
$ dmesg | grep ^CPU0 CPU0: AMD Athlon(tm) 64 Processor 2800+ stepping 0a
,----- | If you intend to use a kernel compiled with these features, you should use | dmesg | grep cpufreq to check if the kernel was able to initialize the | feature. `-----
% dmesg | grep cpufreq || echo no found no found
Sure, because no appropriate driver is loaded.
$ uname -rm 2.6.20-grml i686
Check CPU temperature using tools like sensors/mbmon (depending of your hardware whether what's supported of course).
How would I know if my hardware is supported or not?
What does:
source /usr/bin/cpufreq-detect.sh echo $MODULE
report on your system? Try to load the $MODULE via 'modprobe $MODULE' then, does cpufreq-info report anything then?
BTW, anybody know the 'conservative' governor?
Yes. ;) But I usually prefer the ondemand governor. Check /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor for current settings as soon as cpufreq is working.
regards, -mika-

Thanks for the answer. Here are the updates:
----------------------------- % modprobe thermal && echo OK OK
% cpufreq-info cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006 Report errors and bugs to linux@brodo.de, please. analyzing CPU 0: no or unknown cpufreq driver is active on this CPU
% source /usr/bin/cpufreq-detect.sh
% echo $MODULE powernow-k8
% modprobe $MODULE FATAL: Error inserting powernow_k8 (/lib/modules/2.6.20-grml/kernel/arch/i386/kernel/cpu/cpufreq/powernow-k8.ko): No such device
% dir /lib/modules/2.6.20-grml/kernel/arch/i386/kernel/cpu/cpufreq/powernow-k8.ko -rw-r--r-- 1 root root 15387 05-03 15:10 /lib/modules/2.6.20-grml/kernel/arch/i386/kernel/cpu/cpufreq/powernow-k8.ko
% cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: No such file or directory
% ls /sys/devices/system/cpu/cpu0/cpufreq No such file or directory -----------------------------
To recap, the problems I see are:
- The thermal kernel loaded ok, but cpufreq-info still says no driver is active
- cpufreq-detect.sh successfully detected my CPU module, but modprobe return weird error "No such device".
Here are more testing/info:
----------------------------- % mkdir /sys/devices/system/cpu/cpu0/cpufreq mkdir: cannot create directory `/sys/devices/system/cpu/cpu0/cpufreq': Operation not permitted
% /etc/init.d/powernowd start Starting powernowd: required sysfs objects not found!
$ grep sysfs /etc/fstab sysfs /sys sysfs defaults 0 0
# just shooting into the dark % modprobe cpufreq_userspace && echo OK OK # afterward, cpufreq-info returns the same
% cat /etc/modules # /etc/modules: kernel modules to load at boot time. # # This file should contain the names of kernel modules that are # to be loaded at boot time, one per line. Comments begin with # a `#', and everything on the line after them are ignored.
evdev fuse
# Generated by sensors-detect on Wed Aug 1 18:23:39 2007 # I2C adapter drivers i2c-viapro # Chip drivers eeprom k8temp w83627hf -----------------------------
On Thu, 02 Aug 2007 09:58:25 +0200, Michael Prokop wrote:
BTW, anybody know the 'conservative' governor?
Yes. ;) But I usually prefer the ondemand governor.
Just FYI, seems that conservative is newer than ondemand:
http://www.linuxfromscratch.org/hints/downloads/files/cpufreq.txt : As of 2.6.9, an 'ondemand' driver was made available. Other demand-based governors, such as 'conservative', have been introduced in later kernels.
http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/doc/OLS2006-ondemand... : conservative governor is a fork of the ondemand governor with a slightly different algorithm to decide on the target frequency. Most of the configuration details of ondemand in this paper also holds true for the conservative governor.
Of course, newer might not grantee better. :-)

* - Tong - mlist4suntong@yahoo.com [20070804 00:49]:
Thanks for the answer. Here are the updates:
% modprobe thermal && echo OK OK
Ok.
% cpufreq-info cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006 Report errors and bugs to linux@brodo.de, please. analyzing CPU 0: no or unknown cpufreq driver is active on this CPU
% source /usr/bin/cpufreq-detect.sh
% echo $MODULE powernow-k8
% modprobe $MODULE FATAL: Error inserting powernow_k8 (/lib/modules/2.6.20-grml/kernel/arch/i386/kernel/cpu/cpufreq/powernow-k8.ko): No such device
That's bad, so powernow_k8 does not seem to support your CPU. What's inside your syslog (/var/log/syslog) when you try to load the module (modprobe powernow-k8)?
% cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: No such file or directory
[...]
That's clear, you can't use cpufreq unless the appropriate modules are loaded.
To recap, the problems I see are:
- The thermal kernel loaded ok, but cpufreq-info still says no driver is active
- cpufreq-detect.sh successfully detected my CPU module, but modprobe return weird error "No such device".
Here are more testing/info:
% mkdir /sys/devices/system/cpu/cpu0/cpufreq mkdir: cannot create directory `/sys/devices/system/cpu/cpu0/cpufreq': Operation not permitted
sysfs does not work that way. :)
% /etc/init.d/powernowd start Starting powernowd: required sysfs objects not found!
Sure, as above -> requirements must be fulfilled first of all.
[..]
# Generated by sensors-detect on Wed Aug 1 18:23:39 2007 # I2C adapter drivers i2c-viapro # Chip drivers eeprom k8temp w83627hf
-> What's the output of the 'sensors'-command?
regards, -mika-

* - Tong - mlist4suntong@yahoo.com [070731 12:34]:
Hi,
I rebooted my PC the other day, and only then I know that my CPU is overheated, because I saw a BIOS warning. The fact that my CPU might have been overheated for months made me consider seriously to control my CPU frequency (My AMD cpu has that feature available in bios).
Hi!
You might want to try wether athcool works on your CPU/mobo. If you're not bussy, that'll put the CPU to sleep, and thus lower the temperature (got mine from 56°C to 43°C)
Greetz,
Jan-Pieter Jacobs

On Tue, 31 Jul 2007 12:41:56 +0200, Jan-Pieter Jacobs wrote:
You might want to try wether athcool works on your CPU/mobo.
That's seems more specific to my CPU/mobo. Mika, I'll try this first then your suggestions.
$ athcool stat athcool version 0.3.11 - control power-saving mode on AMD Athlon/Duron CPUs ... no supported Chipset found. nothing changed.
How did you get it working?
Thanks

* - Tong - mlist4suntong@yahoo.com [070801 05:38]:
On Tue, 31 Jul 2007 12:41:56 +0200, Jan-Pieter Jacobs wrote:
You might want to try wether athcool works on your CPU/mobo.
That's seems more specific to my CPU/mobo. Mika, I'll try this first then your suggestions.
$ athcool stat athcool version 0.3.11 - control power-saving mode on AMD Athlon/Duron CPUs ... no supported Chipset found. nothing changed.
Well, then you are out of luck. I do have a supported Chipset...
greetings, Jan-Pieter
participants (3)
-
- Tong -
-
Jan-Pieter Jacobs
-
Michael Prokop