Linux Becomes Slow After Resume / Suspend


Recently, I built a new computer with ASRock J3455-ITX which has a Apollo Lake processor build-in to run Force.com IDE and VisualStudio Code. I have to use OpenSuSE Tumbleweed to replace my favorite Leap because it requires the latest kernel to support Apollo Lake.

Everything seems fine but it becomes very slow after resume / suspend. I have tested many power-related settings in UEFI (Unified Extensible Firmware Interface) and none of them help. If I logout GNOME and login again, I regain my normal speed.

I try to google “linux slow after resume” and found some useful information. It seems related to

Doug Smythies and jat255 provide detail explain and a solution to restore CPU frequency as a service in Slowdown after resume from suspend on ArchLinux.

Compare CPU Frequency

First, you need to compare CPU frequency before and after suspend to validate if this is the case. You may compare CPU frequency before and after suspend.


sudo cpupower frequency-info

Rewrite MSR If  Not Zero

First to run modprobe to add a loadable kernel module (LKM) msr-tools to the Linux kernel. You need to run it every reboot.

MSR Tools project provides utilities to access the processor MSRs and CPU ID directly.

This project is composed of three different user space console applications.

rdmsr – read MSR from any CPU or all CPUs
wrmsr – write values to MSR on any CPU or all CPUs
cpuid – show identification and feature information of any CPU


#sudo modprobe msr

Run the utility to read MSR information.


#sudo rdmsr -a 0x19a

If the returned value is not 0, then write 0 into MSR.


sudo cpupower frequency-info
sudo wrmsr -a 0x19a 0x0

CPU clock slower after each resume from sleep on AskUbuntu reported it doesn't work because his case is not clock modulation (register 0x19A) related.

Reference

  1. ArchLinux: Slowdown after resume from suspend
  2. AskUbuntu: CPU clock slower after each resume from sleep
  3. AskUbuntu: Slow CPU after resume
  4. AskUbuntu: Ubuntu 16.04 LTS too slow after suspend and resume
  5. ASRock J3455-ITX
  6. GNOME
  7. Intel 01.org: msr-tools
  8. Intel: Intel Atom® Processor E3900 Series, Intel® Celeron® Processor N3350, and Intel® Pentium® Processor N4200, Formerly Apollo Lake
  9. OpenSuSE
  10. OpenSuSE Leap
  11. OpenSuSE Tumbleweed
  12. Salesforce Developers: Force.com IDE
  13. VisualStudio Code
  14. Wiki: modprobe
  15. Wiki: Unified Extensible Firmware Interface
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.