4

I have a battery which apparently is dead (I've tried to re-calibrate it with power-calibrate, didn't work).

 $ acpi
Battery 0: Charging, 0%, charging at zero rate - will never fully charge.
Battery 1: Not charging, 0%

As a result CPU frequency is set to the lowest value

 $ grep MHz /proc/cpuinfo 
cpu MHz     : 399.999
cpu MHz     : 400.064
cpu MHz     : 400.001
cpu MHz     : 400.046
 $ sudo cpupower 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: 400 MHz - 2.60 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 2.60 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 400 MHz (asserted by call to kernel)
  boost state support:
    Supported: no
    Active: no

I've tried to set the frequency manually but it fails

 $ sudo cpupower frequency-set -f 2000
Setting cpu: 0
Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
   for example because of hardware which cannot be set to a specific frequency
   or because the userspace governor isn't loaded?

Rising it with sysfs didn't work also,

 $ echo "2000000" | sudo tee -a /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 
2000000
 $ cat /sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq 
400000

How can I disable CPU frequency scaling completely or set it to the maximum?

The problem occurs on Linux & OpenBSD

I'm also able to measure performance degradation with

dd if=/dev/zero bs=1M count=1024 | md5sum -

where it gives me about ~50MB/s, almost 10 times less than expected.

I've tried using 90W and 65W adapters, frequency does not improve.

I've tried removing batteries, still operating on the lowest frequency.

# dmidecode -t processor | grep "Speed"
        Max Speed: 8300 MHz
        Current Speed: 2600 MHz
# lshw -c cpu | egrep "capacity|size"
       size: 400MHz         
       capacity: 4005MHz
andreoss
  • 98
  • 5
  • 17

3 Answers3

3

If manually setting values in sysfs has got no effect, this can be because the frequency is limited at bios level. If your laptop is a Thinkpad, it is certainly because the frequency is limited at bios level.

Make sure you read and understood the page linked here above. This is a security feature and the BIOS must have detected a serious reason for throttling the CPU on its own.
In this precise case, the possible incapability to respond to peak power demands because of the weakness of a standard 65W power adaptor and no battery available in order to supply for the extra.

In case you are sure your adaptor is powerful enough and suspect a buggy BIOS or accept to take the risks of unpredictable behavior (data loss included) and definitely want to ignore this limitation, you can :

change the value in /sys/module/processor/parameters/ignore_ppc from 0 to 1

If you want this setting to survive across reboots, then simply add processor.ignore_ppc=1 to your boot command line.

Now you are on your own, good luck!

MC68020
  • 7,981
  • ignore_ppc didn't work for me. Disabling ACPI in BIOS slightly improves the situation (one core starts to work on 2800 Mhz). – andreoss Apr 09 '22 at 19:16
1

It might be the case that:

  1. You are seeing current cpu frequencies at the time you are executing the command, not maximum freq, see this. So you might be ok without doing anything else.
  2. You are selecting a value not available, see /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies.
  3. The feature is not supported by the kernel, or there is a bug, see /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed: Invalid argument.

You could try:

  1. Using cpupower-gui.
  2. The same without the battery, with both OSs.
  3. The same, from live USB of other distros

Please post the output of the following, for both Linux and OpenBSD (some commands may not be available):

uname -a
lsb_release -a
lscpu | grep "MHz".
sudo dmidecode -t processor | grep "Speed"
lshw -c cpu | egrep "capacity|size"
sudo lshw -c cpu | egrep "capacity|size"
head /sys/devices/system/cpu/cpu0/cpufreq/scaling_*

Please also post the exact model of your PC.

1

I just had the same issue on a Dell laptop:

$ lscpu | grep MHz
CPU MHz:                         200.000
CPU max MHz:                     4800.0000
CPU min MHz:                     800.0000

It turns out that the power cable was simply loose. Re-seating the plug fixed the problem.

Stewart
  • 13,677