# ondemand governor on turion X2 [SOLVED]

## trilexx

hey,

the ondemand governor acts very strange on my system. if there is a cpu load of 50% it stays at 800 Mhz, if there is nothing to do it keeps jumping between 800 and 2000 Mhz or stays at 2000 Mhz forever. I do not use any userspace tools and don't want to if possible. Here are my kernel settings regarding frequency scaling:

```
#

# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=y

CONFIG_CPU_FREQ_DEBUG=y

CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_STAT_DETAILS=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y

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=y
```

and here is some system information:

```
processor       : 0

vendor_id       : AuthenticAMD

cpu family      : 15

model           : 72

model name      : AMD Turion(tm) 64 X2 Mobile Technology TL-60

stepping        : 2

cpu MHz         : 2000.000

cache size      : 512 KB

physical id     : 0

siblings        : 2

core id         : 0

cpu cores       : 2

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 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8legacy ts fid vid ttp tm stc

bogomips        : 3994.19

clflush size    : 64

processor       : 1

vendor_id       : AuthenticAMD

cpu family      : 15

model           : 72

model name      : AMD Turion(tm) 64 X2 Mobile Technology TL-60

stepping        : 2

cpu MHz         : 2000.000

cache size      : 512 KB

physical id     : 0

siblings        : 2

core id         : 1

cpu cores       : 2

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 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8legacy ts fid vid ttp tm stc

bogomips        : 3994.19

clflush size    : 64
```

anybody knows this behaviour? since this is a notebook a working ondemand governor would save me a lot of energy and nerves  :Smile: 

cheers,

trilexx

----------

## Roman_Gruber

hi

i have a turion single core cpu. I have the same problems. My cpu frequency is decreased, when i want full cpu power. Especially when using vba.

I use powernowd, gnome-power-manager, ... 

Seems to be a bit a lag in code since kernel 2.6.20

----------

## trilexx

I have no problems setting the frequency manually or use a different policy like powersave or conservative. But ondemand should also work fine...

----------

## adsmith

try conservative.  It was designed to behave like ondemand, but change more slowly to avoid confusing certain CPUs.

----------

## Cyker

Stupid question: Did you actually tell the kernel to use the "ondemand" governor?

I couldn't help noticing that "CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y" was set, and if you don't have a userspace governor running and didn't tell the kernel to use ondemand, that might be why it's acting funny...?

----------

## trilexx

well, the only two options you have here are:

```

() userspace

() performance

```

I thought I better choose userspace than performance for battery life. And the Gnome Frequency Scaling Monitor shows that ondemand is the default. It is also selected after booting.

trilexx

----------

## adsmith

That default is just what it used until boot is finished, so it makes sense to use "performance" here.  You can easily change the active governor by echo'ing one of the governors listed in /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors to scaling_governor.

The gnome power manager isn't neccesary to do any of this, and if you're trying to debug, it is wise to disable it and do this manually.  Anyway, I've never been happy with the userspace governor, since you then need a daemon sitting around to watch system stats and adjust the CPU speed.  The kernel governors have only simple algorithms, but essentially no overhead.

On my machines, I just toss

```

echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

```

into /etc/conf.d/local.start.

edit:  blech.. typos

----------

## trilexx

ok, I have changed it to performance now. However, this does not change anything. Right now its jumpy again and switching between 2 Ghz and 800 Mhz. man, I have never had problems with notebooks and gentoo, but this piece of hardware drives me mad...

----------

## trilexx

hello again,

I have made some more tests, but couldn't solve the problem. After some time the onDemand governor scales the cpu to 2.0 Ghz and never down anymore, although there is NO significant load. Are there any logs regarding the governors?

----------

## Abraxas

Why don't you want to use a userspace governor?  I use cpufreqd on my core2duo and I used it on my speedstep p3 without any issues at all.

----------

## trilexx

because a userspace governor is not needed, should the onDemand governor work. And it actually does now, after upgrading to the latest kernel 2.6.22-r5. Anyway, I'm not sure if the kernel upgrade did the thing. There have been changes from  2.6.21 to 2.6.22 regarding ACPI and AMD cpus though.

----------

## ozbird

The kernel documentation for the "conservative" governor says:

 *Quote:*   

> 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.

 

Is this latency problem still true for the latest Athlon64 cores?  I assume what they are saying is that the number of steps and/or the time to switch between them means that it doesn't react quickly enough to an increased load with "ondemand", whereas "conservative" will jump to full speed immediately; the latency is less noticable/important stepping the speed down.

----------

