I’ve written about kernel freezes a few times lately, and have spent hours and hours researching what others have done to fix them.
In some forums, they blame bad hardware, like corrupt hard drives or memory segmentation faults etcetera. Testing of hardware always showed me as not having any problems in that area though.
My problem with my Acer Aspire was that any 3.* kernel ran fine without freezes, but most 4.*kernels would freeze. Some, like the 4.4.0+ kernels would freeze all the time, and 4.4.15 would freeze only once a day or so.
Really wanting to have an answer to why it was happening, I finally stumbled on this github thread which was explaining about the CPU feature of being able to save power by changing the current CPU state, or C-state for short. Seems that when my Acer computer was being put into a lower power mode, it would instead just shut down completely!
The repair is very simple, and involves a quick edit to your Grub boot menu.
Do a sudo edit of your /etc/default/grub configuration file to find the line:
As I use medit, the command to edit the file would be:
sudo medit /etc/default/grub
Replace it with this line:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash intel_idle.max_cstate=1″
As shown in the highlighted line of text in the image above, I commented out the original line, and simply added the new one.
After you save the file, do a quick: sudo update-grub to let grub know that you’ve changed it, and then reboot.
This will force the CPU to always run at full power, and in the case of my Acer Aspire XC-603G, preventing the CPU from locking up!
Since I made this change, I’ve had zero freezes on this machine.