
IMHO, the best CPU governor is the "ondemand" governor that you can build into the kernel. You can then activate it at boot by adding this to /etc/conf.d/local.start:SAngeli wrote: 1) CPU scripts (which governor to use) and how to run the scripts
Code: Select all
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governorCode: Select all
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_niceNot sure about this meself, since the BIOS in both of my AMD64 boards does it for me. But as I understand it, you first need to set up lm_sensors properly, then you can run pwmconfig to set up a config file for the fan control utility in /etc/fancontrol. After that's done, just add something like "/usr/sbin/fancontrol &> /var/log/fancontrol.log &" to /etc/conf.d/local.start.SAngeli wrote:2) CPU fan scripts, how to write them and implement them
3) how to monitor and verify both CPU and CPU fan work together.
The way I interpret this, there will be a high latency when switching from the min to the max frequency as the ondemand governor does, but the Athlon 64 has lower latency when gradually stepping up frequency, as the conservative governor does. Any thoughts?If you have a desktop machine then you should really be considering the 'ondemand' governor instead, however if you are using a laptop, PDA or even an AMD64 based computer (due to the unacceptable step-by-step latency issues between the minimum and maximum frequency transitions in the CPU) you will probably want to use this governor
Same issue here, but using the "conservative" governor, as instructed by the kernel config menus (since this a laptop ... and AMD64).Defiance wrote:I can't seem to get the ondemand governor to work. When I echo ondemand into the scaling_governor file, my CPU stays at the same speed as indicated by /proc/cpuinfo. CNQ is enabled in my BIOS, my dmesg shows that powernow is activated without any errors. The governor just doesn't work. I had a similar problem on my P4 laptop that I never resolved. Any ideas?
Okay, I've had to resort to sys-power/powernowd.ankhcraft wrote:Same issue here, but using the "conservative" governor, as instructed by the kernel config menus (since this a laptop ... and AMD64).Defiance wrote:I can't seem to get the ondemand governor to work. When I echo ondemand into the scaling_governor file, my CPU stays at the same speed as indicated by /proc/cpuinfo. CNQ is enabled in my BIOS, my dmesg shows that powernow is activated without any errors. The governor just doesn't work. I had a similar problem on my P4 laptop that I never resolved. Any ideas?
EDIT: let me also add that I *do* have cpufreq statistics support built-in to the kernel and I can see clearly that 0 state transitions have taken place.

Code: Select all
powernowd -dv
PowerNow Daemon v0.90hun6, (c) 2003-2004 John Clemens
Settings:
verbosity: 1
mode: 1 (AGGRESSIVE)
step: 100 MHz (100000 kHz)
lowwater: 20 %
highwater: 80 %
poll interval: 1000 ms
Found 1 physical cpu and 2 virtual cpus:
cpu0: 1000000 kHz - 2000000 kHz
Code: Select all
Before decide_speed
decide_speed()
decide_speed(cpu = 0x505880)
decide_speed(phys_cpuid = 0)
get_stat(cpu = 0x505880)
get_stat(phys_cpuid = 0)
before loop
Reading stats for physical cpu0)
Reading stats for virtual cpu0 (physical cpu0)
before strtol
Reading stats for virtual cpu1 (physical cpu0)
before strtol
after loop
phys cpu0 usage 86, total 99
phys cpu0 percentage = 0.868687Code: Select all
Can't open scaling_setspeed: No such file or directoryCode: Select all
conservative ondemand powersave userspace performanceany idea how i can get this up and running ? ..cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
2000000 1800000 1000000
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 35
model name : AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
stepping : 2
cpu MHz : 1000.000
cache size : 512 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse
36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_l
m cmp_legacy
bogomips : 2012.83
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp
processor : 1
vendor_id : AuthenticAMD
cpu family : 15
model : 35
model name : AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
stepping : 2
cpu MHz : 1000.000
cache size : 512 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse
36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_l
m cmp_legacy
bogomips : 2012.83
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

My system is a Sempron 2800 (1.6Ghz 256K cache) on a AsRock K8NF6G-VSTAstrites wrote:WHO HAD THE SCALING PROBLEM PLEASE READ THIS!!!
please go to http://bugzilla.kernel.org/show_bug.cgi?id=4392#c1 and download the patch
follow the patch instruction ftom http://www.linuxhq.com/patch-howto.html and try!
(after applying the patch you need to do "make" and copy the bzImage to /boot , change the bootloader accordingly and reboot the new kernel)
This solved the problem for me

Code: Select all
$ dmesg | grep powernow
powernow-k8: Power state transitions not supported
Code: Select all
$ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 44
model name : AMD Sempron(tm) Processor 2800+
stepping : 2
cpu MHz : 1596.367
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow up pni lahf_lm ts ttp tm stc
bogomips : 3195.24
Code: Select all
$ cat /proc/acpi/processor/CPU1/info
processor id: 0
acpi id: 1
bus mastering control: no
power management: no
throttling control: yes
limit interface: yes
$ cat /proc/acpi/processor/CPU1/limit
active limit: P0:T0
user limit: P0:T0
thermal limit: P0:T0
$ cat /proc/acpi/processor/CPU1/power
active state: C1
max_cstate: C8
bus master activity: 00000000
states:
*C1: type[C1] promotion[--] demotion[--] latency[000] usage[00000000] duration[00000000000000000000]
$ cat /proc/acpi/processor/CPU1/throttling
state count: 16
active state: T1
states:
T0: 00%
*T1: 06%
T2: 12%
T3: 18%
T4: 24%
T5: 31%
T6: 37%
T7: 43%
T8: 49%
T9: 55%
T10: 62%
T11: 68%
T12: 74%
T13: 80%
T14: 86%
T15: 93%
Code: Select all
$ ls /sys/devices/system/cpu/cpu0/
crash_notes topology


This option is missing on the BIOS menu, but thanks for stating the obvious.giantrabbit wrote:The CnQ thingy is disabled by default on the ASUS mobo, turn it on in ur BIOS.DrDoverylittle wrote:I have an AMD Sempron 2800+ and ASUS K8V-VM mobo ....

Its not really the power consumption that i am bothered about, but it would be nice to have one step lower at around 800 MHz, as appears in some of the links from the page i showed, as i could slow down the cpu fan rate when not in use and reduce noise. Its not really an over reaction, if they don't think it is needed for certain processors then they should say that. All the numbers you quote have one step which is significantly smaller than all the rest, which makes a nice quite 'sleep' mode. I will just have to get used to it like sleeping with a snoring partner.hvengel wrote:I think that this is a bit of an over reaction. The semperon 2800 is only a 1.6Ghz CPU and with its small cash and simplified single channel memory controller at that speed already has a fairly low power consumption. It appears that AMD engineers decided that there is are CPU speeds slow enough that the added over head of speed stepping was not worth it. It appears that this is at the 1.8Gz level. I have an AMD64 3000 and it's ACPI speed states are 1Ghz and 1.8Ghz. And an amd64 3500 which has speed states of 1.0Ghz, 1.8Ghz. 2.0Ghz and 2.2Ghz. I also have a 4800+ and its speed states are 1Ghz, 1.8Ghz, 2.0Ghz, 2.2Ghz and 2.4Ghz. I also suspect that by disabling speed stepping on these slower CPUs that power consumption is reduced a little since it should be possible to disable some additional circuits on the chip.

Code: Select all
ls /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ -al
total 0
drwxr-xr-x 2 root root 0 Feb 23 10:00 .
drwxr-xr-x 4 root root 0 Feb 23 10:00 ..
-rw-r--r-- 1 root root 4096 Feb 23 10:00 ignore_nice_load
-rw-r--r-- 1 root root 4096 Feb 23 10:00 powersave_bias
-rw-r--r-- 1 root root 4096 Feb 23 10:00 sampling_rate
-r--r--r-- 1 root root 4096 Feb 23 10:00 sampling_rate_max
-r--r--r-- 1 root root 4096 Feb 23 10:00 sampling_rate_min
-rw-r--r-- 1 root root 4096 Feb 23 10:00 up_thresholdI take it this means Opterons don't have speed scaling.hvengel wrote:All amd64 other than the Opterons have speed scaling as a standard feature. Many desktop users of the amd64s setup their machines to speed scale because it reduces power consumption, heat and (if the fan is speed controlled) noise.
Code: Select all
# modprobe powernow-k8
FATAL: Error inserting powernow_k8 (/lib/modules/2.6.18-gentoo-r6.Daniel.Jozsef.20070112.02/kernel/arch/x86_64/kernel/cpufreq/powernow-k8.ko): No such device

Had similar thoughts with my X2 4200+. What works for me:drescherjm wrote:Hi I am trying to archive what a few people wanted to avoid on page 3 of this thread...
Since I am running this on a desktop system (dual processor opteron at that), I want to minimize the performance loss of power management but still keep the processors cool. Basically I want the cpus to go up fast but down very slow. It frustrates me every time I see my gdesklet say I am running at 1GHz while I am transcoding a 2 GB mpeg.
<snip>
Code: Select all
#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_STAT=y
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=yCode: Select all
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 25 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold

Code: Select all
$ dmesg | grep k8
powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3500+ processors (version 2.00.00)
powernow-k8: invalid freq entries 3900000 kHz vs. 65535000 kHz
powernow-k8: invalid freq entries 3900000 kHz vs. 65535000 kHz
powernow-k8: 0 : fid 0xe (2200 MHz), vid 0x2
powernow-k8: 1 : fid 0xc (2000 MHz), vid 0x6
powernow-k8: 2 : fid 0xa (1800 MHz), vid 0xa
powernow-k8: 3 : fid 0x2 (1000 MHz), vid 0x12
Code: Select all
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
conservative ondemand powersave userspace performance
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
2200000 2000000 1800000 1000000
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ondemand
Code: Select all
$ cpufreq-info
cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to linux@brodo.de, please.
analyzing CPU 0:
driver: powernow-k8
CPUs which need to switch frequency at the same time: 0
hardware limits: 1000 MHz - 2.20 GHz
available frequency steps: 2.20 GHz, 2.00 GHz, 1.80 GHz, 1000 MHz
available cpufreq governors: conservative, ondemand, powersave, userspace, performance
current policy: frequency should be within 1.80 GHz and 1.80 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.80 GHz (asserted by call to hardware).I can change de frequency, but the Vcore is the same for each freqency : 1.5 Vpowernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3000+ processors (version 2.00.00)
powernow-k8: invalid freq entries 3900000 kHz vs. 65535000 kHz
powernow-k8: invalid freq entries 3900000 kHz vs. 65535000 kHz
powernow-k8: invalid freq entries 3900000 kHz vs. 65535000 kHz
powernow-k8: 0 : fid 0xc (2000 MHz), vid 0x2
powernow-k8: 1 : fid 0xa (1800 MHz), vid 0x6
powernow-k8: 2 : fid 0x2 (1000 MHz), vid 0x12
but there aren't any voltage.....# dmesg |grep power
powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3000+ processors (version 2.00.00)
powernow-k8: 0 : fid 0xc (2000 MHz), vid 0x2
powernow-k8: 1 : fid 0xa (1800 MHz), vid 0x6
powernow-k8: 2 : fid 0x2 (1000 MHz), vid 0x12

Code: Select all
# dmesg |grep power
powernow-k8: Found 2 AMD Opteron(tm) Processor 850 processors (version 2.00.00)
powernow-k8: 0 : fid 0x10 (2400 MHz), vid 0x8
powernow-k8: 1 : fid 0xe (2200 MHz), vid 0x8
powernow-k8: 2 : fid 0xc (2000 MHz), vid 0xa
powernow-k8: 3 : fid 0xa (1800 MHz), vid 0xc
powernow-k8: 4 : fid 0x2 (1000 MHz), vid 0x12
powernow-k8: 0 : fid 0x10 (2400 MHz), vid 0x8
powernow-k8: 1 : fid 0xe (2200 MHz), vid 0x8
powernow-k8: 2 : fid 0xc (2000 MHz), vid 0xa
powernow-k8: 3 : fid 0xa (1800 MHz), vid 0xc
powernow-k8: 4 : fid 0x2 (1000 MHz), vid 0x12