8

So far I've found temporary solution for my problem at Maximum CPU frequency stuck at low value, but the question that I have is how to make it permanent. Right after reboot, frequencies are set back to stock 1.90GHz.

CPU Model = Intel(R) Core(TM) i7-3517U CPU @ 1.90GHz

/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies = 2401000 2400000 2300000 2200000 2100000 1900000 1800000 1700000 1600000 1500000 1400000 1300000 1100000 1000000 900000 800000 [kHz]

/sys/devices/system/cpu/cpufreq/boost = 1

Some other information that might be, or not, relevant:

vitaliy:~$ cat /sys/devices/system/cpu/cpu0/cpufreq/bios_limit 1900000

and...

vitaliy:~$ cat /sys/module/processor/parameters/ignore_ppc0

From what I've noticed, ignore_ppc and scaling_available_frequencies are overwritten every time on boot/reboot. Not sure for bios_limit.

V.P.
  • 311

2 Answers2

13

Ok, the problem was at bios_limit.

To start, override any BIOS limitations by setting ignore_ppc to 1:

echo 1 > /sys/module/processor/parameters/ignore_ppc

Then, change CPU scaling_max_freq for all cores using this script [pay attention to core's numbers! In my case quad-core, core's numbers: 0, 1, 2, 3]:

for x in /sys/devices/system/cpu/cpu[0-3]/cpufreq/;do 
  echo 2400000 > $x/scaling_max_freq
done

Source: http://blog.patshead.com/2013/04/my-bios-is-limiting-my-cpu-clock-speed.html

Now, since you can't edit bios_limit files, you have to force kernel to ignore it.

Edit /etc/default/grub (you need to do this using root privilege) and change

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash processor.ignore_ppc=1"

then run:

sudo update-grub

and reboot.

Source: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/856233 Comment NÂș 24.

Now the CPU frequencies are at 2.4GHz, as desired, while using AC power.

/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor  = ondemand
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq  =  2400000 [kHz]

/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor  = ondemand
/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq  =  2400000 [kHz]

/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor  = ondemand
/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq  =  2400000 [kHz]

/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor  = ondemand
/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq  =  2400000 [kHz]
V.P.
  • 311
0

One approach is to create a script which performs the temporary solution, then make the script run on every boot, by adding the script in System > Preferences > Startup Applications or in cron.