Slow CPU after resume

Sometimes after putting my laptop to sleep it's CPU is locked to the slowest frequency - about 600-700MHz.

My laptop is Dell E6420 with i5-2520m.
Kernel version: 4.6.0-040600-generic.
I first came across this bug in 14.04 release. And now we have 16.04 and it's still there.

I am working on my laptop, everything is fine, quick and smooth. I close the lid, putting my laptop to sleep, disconnect power, it is sleeping on it's battery. I come back after some time, open the lid. And everything is slow as hell;D
I check cpu frequency using

watch -n 1 'cat /proc/cpuinfo | grep MHz'

and I see all my cores working on ~600Mgz frequency.

I check scaling governors

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

And I see 'powersave'.

To 'fix' this I have to do something like this

echo 'performance' > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 'performance' > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo 'performance' > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo 'performance' > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

After that everything is quick as before.

CPU scaling driver is intel_pstate checked with

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

I'm tired that I always have run this script. It's like I cannot rely on Ubuntu or my laptop(I don't know whose fault it is) anymore.

Why CPU is slow after sleep. Why does this happen? How to resolve this bug?


The issue you have with your LapTop is a known problem with some Dell LapTops. When you resume from suspend on battery power, the Dell bios will set Clock Modulation to be used as a way to limit performance a little to save battery power. The problem is that the intel_pstate CPU frequency scaling driver, in its current form, is incompatible with Clock Modulation, and instead of limiting performance a little it drivers the CPU frequency hard down to below its normal lower limit.

The suggested solution for you is that you disable the intel_pstate driver, and use the acpi-cpufreq CPU frequency scaling driver instead. The acpi-cpufreq driver responds "properly" to Clock Modulation.

If you are using grub, then edit /etc/default/grub and change the GRUB_CMDLINE_LINUX_DEFAULT line. Example, where I have something else on that line:

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 intel_pstate=disable"

Be sure to run sudo update-grub afterwards. It is also good practice to save a copy of the original file before you edit it. Edit as sudo.