# ondemand, userspace power governors not available

## krotuss

Hi, ondemand and userspace power governors are not available on my system, even though they are enabled in kernel confiig..

```

uname -a

Linux gentoo 4.4.6-gentoo #4 SMP PREEMPT Sun Apr 24 18:37:20 CEST 2016 x86_64 Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz GenuineIntel GNU/Linux

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

performance powersave

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver

intel_pstate

grep CONFIG_CPU_FREQ_GOV /usr/src/linux/.config

CONFIG_CPU_FREQ_GOV_COMMON=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

```

Why is it so and how can I fix it? Thanks.

----------

## Ant P.

They're not supported or needed on that CPU, setting it to performance is effectively what ondemand would be. intel_pstate works a lot different to other cpufreq drivers (the CPU itself knows how much load it has), so it doesn't make sense to try and control it in software.

----------

## krotuss

Thanks, I assume that this is some recent (4.4?) change in kernel, because when I was, not so long time ago, setting up the box those governors were working.

----------

## Polyatomic

 *krotuss wrote:*   

> Thanks, I assume that this is some recent (4.4?) change in kernel, because when I was, not so long time ago, setting up the box those governors were working.

 

I dunno man! check this out from the Docs in the kernel: intel-pstate.txt

```
For contemporary Intel processors, the frequency is controlled by the

processor itself and the P-State exposed to software is related to

performance levels.  The idea that frequency can be set to a single

frequency is fictional for Intel Core processors. Even if the scaling

driver selects a single P-State, the actual frequency the processor

will run at is selected by the processor itself.

```

I think these docs are relevant to your cpu, maybe the other box had a different

processor?. 

Take it easy man! and maybe I'll see ya round.

```
root@milton:/sources/linux-stable/Documentation/cpu-freq# cpupower --cpu all frequency-info

analyzing CPU 0:

  driver: intel_pstate

  CPUs which run at the same hardware frequency: 0

  CPUs which need to have their frequency coordinated by software: 0

  maximum transition latency:  Cannot determine or is not supported.

  hardware limits: 1.20 GHz - 3.20 GHz

  available cpufreq governors: performance powersave

  current policy: frequency should be within 1.20 GHz and 3.20 GHz.

                  The governor "powersave" may decide which speed to use

                  within this range.

  current CPU frequency: 1.20 GHz (asserted by call to hardware)

  boost state support:

    Supported: yes

    Active: yes
```

----------

## Astronome

Also see http://www.phoronix.com/scan.php?page=news_item&px=MTM3NDQ.

----------

## kernelOfTruth

you can append

```
intel_pstate=disable
```

to your bootloader (grub, etc.)

and then set the governor via e.g.

```
cpupower frequency-set -g performance
```

```
cpupower frequency-set -g ondemand
```

running on 4.6.2 ondemand is broken for me (Haswell CPU), frequency stays at lowest level, even with high load (800%),

so I'm currently using the performance governor.

There is (or was) a regression with pstate driver on 4.7 which lead to worse performance compared to ondemand governor,

so if you run into performance and smoothness issues it would be advisable to compare pstate against "old" cpu governor behavior

----------

## toralf

FWIW "pstate" had have a lot of nasty bugs in the past, whilst ondemand worked fine for years.

OTOH since a while pstate works fine here for my i5 :

Linux t44 4.5.7-hardened-r1 #1 SMP Sun Jun 12 22:08:30 CEST 2016 x86_64 Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz GenuineIntel GNU/Linux

----------

