1

Since my previous question on this topic: Can't use “userspace” cpufreq governor and set cpu frequency, I upgraded my kernel a few times and I ran into another problem: cpupower doesn't seem to show and set the cpu frequency in a reliable way.

First, some information:

# uname -a
Linux yoga 4.0.5-gentoo #3 SMP Tue Jul 21 08:43:04 HKT 2015 x86_64 Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz GenuineIntel GNU/Linux

# cpupower frequency-info                                 
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 10.0 us.
  hardware limits: 782 MHz - 1.70 GHz
  available frequency steps: 1.70 GHz, 1.70 GHz, 1.60 GHz, 1.50 GHz, 1.40 GHz, 1.30 GHz, 1.20 GHz, 1.10 GHz, 1000 MHz, 900 MHz, 800 MHz, 782 MHz
  available cpufreq governors: conservative, ondemand, powersave, userspace, performance
  current policy: frequency should be within 782 MHz and 1.70 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 1.70 GHz (asserted by call to hardware).
  cpufreq stats: 1.70 GHz:90.12%, 1.70 GHz:0.00%, 1.60 GHz:0.64%, 1.50 GHz:0.00%, 1.40 GHz:0.00%, 1.30 GHz:0.00%, 1.20 GHz:0.00%, 1.10 GHz:0.00%, 1000 MHz:0.00%, 900 MHz:0.00%, 800 MHz:0.00%, 782 MHz:9.25%  (267)
  boost state support:
    Supported: yes
    Active: yes
    2400 MHz max turbo 4 active cores
    2400 MHz max turbo 3 active cores
    2400 MHz max turbo 2 active cores
    2600 MHz max turbo 1 active cores

And now the weird stuff:

# cpupower frequency-info|grep -P "The governor|CPU frequency"
                  The governor "performance" may decide which speed to use
  current CPU frequency is 1.70 GHz (asserted by call to hardware).

# grep MHz /proc/cpuinfo
cpu MHz         : 1701.000
cpu MHz         : 1701.000
cpu MHz         : 1701.000
cpu MHz         : 1701.000

# cpupower frequency-set -f 800
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3

# cpupower frequency-info|grep -P "The governor|CPU frequency"
                  The governor "userspace" may decide which speed to use
  current CPU frequency is 1.70 GHz (asserted by call to hardware).

# grep MHz /proc/cpuinfo
cpu MHz         : 782.000
cpu MHz         : 782.000
cpu MHz         : 782.000
cpu MHz         : 782.000

# cpupower frequency-set -f 1700
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3

# cpupower frequency-info|grep -P "The governor|CPU frequency"
                  The governor "userspace" may decide which speed to use
  current CPU frequency is 1.70 GHz (asserted by call to hardware).

# grep MHz /proc/cpuinfo                                      
cpu MHz         : 782.000
cpu MHz         : 782.000
cpu MHz         : 782.000
cpu MHz         : 782.000

# cpupower frequency-set -g performance
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3

# cpupower frequency-info|grep -P "The governor|CPU frequency"
                  The governor "performance" may decide which speed to use
  current CPU frequency is 1.70 GHz (asserted by call to hardware).

# grep MHz /proc/cpuinfo
cpu MHz         : 1701.000
cpu MHz         : 1701.000
cpu MHz         : 1701.000
cpu MHz         : 1701.000

To summarize:

  1. When I set the frequency to 800, cpupower sets it to 782, and says it is still 1700 (asserted by call to hardware!)
  2. When I set the frequency back to 1700, cpupower does nothing (and still says it is 1700)
  3. When I set the governor to "performance", cpupower finally sets the frequency to 1700

Is there a way to make cpupower work reliably? Or is it a bug?

1

Ok, this is a bit embarrassing... shortly after posting the question, I started looking into some more details, and found that I should actually add "MHz" to my numbers, as the default unit seems to be kHz.

Now the commands cpupower frequency-set -f 800MHz and cpupower frequency-set -f 1700MHz seem to work reliably and cpupower frequency-info shows the expected information.

One unexplained thing still remains: cpupower frequency-info shows 1.70 GHz when the real frequency is 782 MHz. Even if I set it using cpupower frequency-set -f 782MHz.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.