3

Since my upgrade from 19.04 to 19.10, I experience regular short freezes/lags on my Ubuntu system. I can see that some have similar issues (this post or that one). It is not only mouse freezes but system ones.

My computer is a DELL XPS 13 9343 (same series but different model than the first post mentioned).

I upgraded the BIOS from A13 to A20, no difference. I have 8GB of RAM and 16 of swap, with vm.swappiness=60.

EDIT :

$ ls -al ~/.local/share/gnome-shell/extensions
total 12
drwxrwxr-x 3 mhr mhr 4096 sept. 10 15:29 .
drwx------ 3 mhr mhr 4096 nov.  12 08:56 ..
drwxrwxr-x 4 mhr mhr 4096 sept. 10 15:29 desktop-icons@csoriano

enter image description here

EDIT 2 :

free -h
              total        used        free      shared  buff/cache   available
Mem:          7,7Gi       5,0Gi       590Mi       958Mi       2,1Gi       1,5Gi
Swap:          15Gi       404Mi        15Gi

and

$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda4 during installation
UUID=33ef7645-839a-4b28-b627-e936853a7783 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=48E3-73DB  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda5 during installation
UUID=816ab8c7-f980-4e93-9908-8a9f1dc4a616 none            swap    sw              0       0

EDIT 3:

$ sudo ./magician -L
================================================================================================
Samsung(R) SSD Magician DC Version 2.0
Copyright (C) 2015 SAMSUNG Electronics Co. Ltd. All rights reserved.
================================================================================================
Bad argument "name", expected an absolute path in /dev/ or /sys or a unit name: Invalid argument
----------------------------------------------------------------------------
| Disk   | Model   | Serial  | Firmware  | Capacity | Drive  | Total Bytes |
| Number |         | Number  |           |          | Health | Written     |
----------------------------------------------------------------------------
No Samsung SSD found!
mhr
  • 93
  • Edit your question and show me ls -al ~/.local/share/gnome-shell/extensions and screenshot(s) of the Disks app SMART Data window. 16G swap is excessive, but lets try vm.swappiness=80 and see if things improve. – heynnema Nov 11 '19 at 22:21
  • I have a Dell Venue Pro 7140 and I noticed the same thing. If you can, boot into any pre-5.2 kernel. There seems to be quite a number of issues affecting Dell machines from kernel 5.2.0 onwards. I backtracked my 19.10 from 5.3.0 to 5.0.0 and it's working brilliantly. :-) – tudor -Reinstate Monica- Nov 12 '19 at 10:04
  • @heynnema here you go. It seems a bit better with vm.swappiness=80 (freezes/lags are less recurrent and long). – mhr Nov 12 '19 at 15:26
  • Thank you for the information. Is your boot disk a HDD or SSD? Edit your question and show me free -h and cat /etc/fstab. – heynnema Nov 12 '19 at 16:18
  • It's a SSD, I've edited the question, thanks. – mhr Nov 12 '19 at 16:52
  • Make sure that you start comments to me with @heynnema or I'll surely miss them. What make/model is your SSD? – heynnema Nov 12 '19 at 19:13
  • @heynnema sorry about that, my SSD is a SAMSUNG PM851 M.2 2280 256GB. – mhr Nov 12 '19 at 21:51
  • Go to https://www.samsung.com/semiconductor/minisite/ssd/product/consumer/magician/ and download the Samsung Magician software, and check that the firmware in your SSD is current. Report back. – heynnema Nov 12 '19 at 22:57
  • @heynnema I had to use Magician DC for enterprise since the one for consumers only works on Windows. I edited my question with the result : No Samsung SSD found! but I think it is because Samsung stopped supporting consumer SSDs on Linux so this magician only works with datacenter SSDs : https://askubuntu.com/questions/537471/samsung-magician-on-ubuntu-14-04 – mhr Nov 13 '19 at 10:31
  • Yes, the working Samsung Magician requires Windows to run. If you don't have Windows, you might be able to create a bootable FreeDOS USB flash drive and run the .exe from there. However, for testing, lets try this... in terminal, type... sudo swapoff -a. This will disable swap. Run and see if there's any difference. If you load up too much, it WILL hang, but for testing, see if normal usage works any different. To re-enable sudo swapon -a. I need to see if we need to make you a smaller swap space. – heynnema Nov 13 '19 at 15:58
  • @heynnema It seems to make things better indeed. In the first post I mentioned, 2 solutions are now offered : disabling swap and using alternative graphic drivers. – mhr Nov 15 '19 at 21:15
  • Don't run with no swap. I only did that to narrow down potential problem areas. Reduce your swap from 16G to 4G, set vm.swappiness=80. Reboot. Check operation. Report back. If you still have problems, make sure you've got the latest video drivers. – heynnema Nov 15 '19 at 22:17
  • @heynnema I'd say it makes things worse with 4GB swap, unfortunately. And I only have an Intel(R) HD Graphics 5500, so no additional drivers available. – mhr Nov 17 '19 at 14:07
  • After reducing swap to 4G, did you set vm.swappiness? – heynnema Nov 17 '19 at 14:42
  • @heynnema sorry I didn't think I had to do it again after reducing swap. So now it's way better indeed, even if I get some freezes now and then. Thanks! – mhr Nov 18 '19 at 09:43
  • How did you set vm.swappiness? – heynnema Nov 18 '19 at 12:21
  • @heynnema I used sudo sysctl vm.swappiness=80 – mhr Nov 18 '19 at 14:30
  • 1
    @mhr that only sets vm.swappiness for that boot. Please see my answer for a permanent setting method. Please remember to accept my answer if it was helpful, by clicking on the checkmark icon just to the left of my answer. You can also click the up arrow icon for me. Thanks! – heynnema Nov 18 '19 at 23:53

2 Answers2

2

From the comments...

To slightly re-tune your system, we'll make adjustments to your swap, and see if that helps.

  • reduce swap from 16G to 4G

  • set vm.swappiness to 80 (60 is the default)

sudo sysctl -w vm.swappiness=80 # make more use of swap

sudo sysctl -p # use the values from the current sysctl.conf

heynnema
  • 70,711
  • Marked as best answer, thanks! The underlying issue seems to be solved in the new 5.4 kernel, see https://askubuntu.com/questions/1185491/ubuntu-19-10-freezes-and-lags-reguarly – mhr Nov 19 '19 at 09:31
0

The problem is caused by swapping and disk writes in general, prehpas due to some kernel regression. Fiddling with swap size and swappiness might help a little, but will not remove problem completely. I got rid of the freezes by downgrading to kernel 5.2.21 from https://kernel.ubuntu.com/~kernel-ppa/mainline/

I'm now running this kernel for 2 days with no problem, micro-freezes are gone and system runs very smoothly.