#16 Thinkpad P53 + SSD Kingston A2000 = Freeze
2020-07-29 18:15:46
I have been testing Ubuntu 20 LTS on a Thinkpad P53. The laptop had only a SSD with 512GB by default, so I added a Kingston A2000 with 1TB (NVMe), making it my main drive for Ubuntu, while the original one had Windows 10 for dual boot with GRUB in cases of rare necessity (I have been avoiding W10 for some time now, because I feel that it became to dictatorial, it changes user configurations after updates without consent, and it became to intrusive with marketing and data thief, and let's not talk about the days when one get in the morning to a meeting, boot up the beast and a 30 minutes update-install starts running, while everyone is waiting for you to start your presentation).
Unfortunately my experience with this new laptop didn't start with the right foot (before I had the P52s and loved it, almost perfect machine). I started noticing freezes in the middle of work, to the point nothing responded, even the keyboard lights (like CapsLock) stopped completely, only a forced reboot would solve it (magic key to the rescue Sysrq+Alt+B).
After some tests and try and error I found out the freeze occurred only under I/O operations with the SSD (copy pasting or compiling code for example). Linux SmartTools tests indicated that the SSD was healthy, so it was not physical. I updated the BIOS and the SSD firmware for the most recent versions but it didn't change anything.
The caused seams to be something related to the APST (power management), that interferes with the I/O heavy operations when the SSD is under load. A solution was to disable it directly in the Kernel load trough GRUB adding this parameter:
nvme_core.default_ps_max_latency_us=0
To this moment I had no more freezes after repeating the same tests. I am stil researching but this seams to solve it for now.
To apply it edit this file (with Nano for example):
sudo nano /etc/default/grub
On the line that reads «GRUB_CMDLINE_LINUX_DEFAULT="quiet splash» (depending on your system configuration it could change, this is the default on mine - just append to the end of the line with a space before in case you have additional parameters) add the parameter that disables the APST that interfered with the SSD. In the end it should be something like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvme_core.default_ps_max_latency_us=0"
Update the GRUB by running:
sudo update-grub
And done, no more freezes on the Thinkpad P53 with custom SSD and Ubuntu 20 LTS.