Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Kernel bug swap

Writer Andrew Mclaughlin

Ubuntu 18 bugged and I noticed this messages in my /var/log/syslog file:

I often have issues with the swap, the kswapd0 process running and taking a lot of CPU. What can I do to prevents all these bugs?

Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113350] ------------[ cut here ]------------
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113352] kernel BUG at /build/linux-hwe-uR14Ux/linux-hwe-5.3.0/mm/zswap.c:1166!
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113359] invalid opcode: 0000 [#1] SMP PTI
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113362] CPU: 1 PID: 5908 Comm: gnome-shell Tainted: P OE 5.3.0-42-generic #34~18.04.1-Ubuntu
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113364] Hardware name: LENOVO 80X7/LNVNB161216, BIOS 4MCN33WW(V2.05) 07/19/2018
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113369] RIP: 0010:zswap_frontswap_load+0x1b0/0x1c0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113372] Code: e8 75 d5 b7 00 41 89 c7 41 83 ac 24 98 12 00 00 01 48 8b 43 28 48 8b 73 30 48 8b 38 e8 e9 c4 03 00 45 85 ff 0f 84 12 ff ff ff <0f> 0b e8 c9 6a e1 ff 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113374] RSP: 0000:ffffb6dd0332fb48 EFLAGS: 00010282
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113376] RAX: ffffffffa14bfd60 RBX: ffff966c9e6d73b8 RCX: ffff966b85e76f4a
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113377] RDX: ffff966e01154000 RSI: ffff966b85e76e80 RDI: ffff966e37cc0000
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113379] RBP: ffffb6dd0332fb88 R08: 0000000000000c98 R09: 0000000000000112
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113380] R10: ffff966b85e76fef R11: ffff966e01155000 R12: ffff966de1dd0000
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113381] R13: ffff966e2f4b2658 R14: ffff966e2f4b2650 R15: 00000000ffffffea
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113383] FS: 00007f432c805ac0(0000) GS:ffff966e39c80000(0000) knlGS:0000000000000000
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113385] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113386] CR2: 00005652fccc45e0 CR3: 0000000253542006 CR4: 00000000003606e0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113387] Call Trace:
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113392] __frontswap_load+0x73/0xd0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113394] swap_readpage+0x74/0x1f0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113397] swap_cluster_readahead+0x1db/0x2b0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113400] swapin_readahead+0x60/0x4e0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113402] ? find_get_entry+0x58/0x160
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113404] ? swapin_readahead+0x60/0x4e0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113406] ? pagecache_get_page+0x2c/0x2b0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113409] do_swap_page+0x31b/0x990
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113411] ? do_swap_page+0x31b/0x990
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113414] __handle_mm_fault+0x77a/0x1230
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113416] ? __cgroup_account_cputime+0x28/0x30
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113419] handle_mm_fault+0xcb/0x210
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113423] __do_page_fault+0x2a1/0x4d0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113425] do_page_fault+0x2c/0xe0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113429] page_fault+0x34/0x40
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113431] RIP: 0033:0x7f43298735e8
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113433] Code: 70 48 83 fa 40 72 47 0f 10 06 0f 10 4e 10 0f 10 56 20 0f 10 5e 30 0f 10 64 16 f0 0f 10 6c 16 e0 0f 10 74 16 d0 0f 10 7c 16 c0 <0f> 11 07 0f 11 4f 10 0f 11 57 20 0f 11 5f 30 0f 11 64 17 f0 0f 11
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113434] RSP: 002b:00007ffecca60188 EFLAGS: 00010246
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113436] RAX: 00005652fccc45e0 RBX: 0000000000000005 RCX: 000000000000003f
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113437] RDX: 0000000000000040 RSI: 00005652f22f6cd0 RDI: 00005652fccc45e0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113439] RBP: 0000000000004d40 R08: 00005652f22f6bd0 R09: 00005652fccbf8a0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113440] R10: 0000000000000000 R11: 0000000000000000 R12: 00005652fccbf8a0
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113441] R13: 00005652f22f6bd0 R14: 0000000000000040 R15: 0000000000000000
Mar 18 19:55:14 adam-Lenovo-YOGA-720-15IKB kernel: [67157.113443] Modules linked in: btrfs xor zstd_compress raid6_pq ufs qnx4 hfsplus hfs minix ntfs msdos jfs xfs libcrc32c vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) rfcomm vmw_vsock_vmci_transport vsock vmw_vmci ccm thunderbolt hidp cmac bnep snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio nls_iso8859_1 hid_sensor_accel_3d hid_sensor_als hid_sensor_trigger industrialio_triggered_buffer kfifo_buf hid_sensor_iio_common industrialio hid_sensor_custom nvidia_uvm(OE) 8250_dw hid_multitouch wacom hid_sensor_hub mei_hdcp intel_rapl_msr x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_intel snd_intel_nhlt snd_hda_codec snd_hda_core snd_hwdep snd_pcm aesni_intel snd_seq_midi snd_seq_midi_event aes_x86_64 crypto_simd cryptd glue_helper snd_rawmidi intel_cstate intel_rapl_perf snd_seq ath10k_pci ath10k_core intel_wmi_thunderbolt wmi_bmof serio_raw ath snd_seq_device snd_timer mac80211 snd

EDIT

As advised by @heynnema I have removed the zswap feature and unfortunately my Ubuntu 18 crashed yesterday before 21:36.

My desktop is really charged:Screenshot Ubuntu

And using all the time a lot of swap:

 adam@adam-Lenovo-YOGA-720-15IKB:~$ free -h total used free shared buff/cache available Mem: 7.5G 5.3G 158M 1.4G 2.1G 567M Swap: 15G 5.2G 10G

My screen froze and I had once to again to do a hard reboot! It froze when I was downloading a big file of 7Gb. It often crash when I download big files, and to avoid system crash I quit a lot of apps before download. Don't know why maybe because it needs ram to download the file. If I download a 20Gb file, do I need 20Gb of RAM? Strange.

I have a laptop, so I can't had some new RAM for now.

What I am using as apps, I was using the same apps on Windows 10 and must admit I get these RAM/SWAP issues only on Linux!

I couldn't find any information on my log files, please find:

  • kernellog:
  • syslog:

EDIT2

For Opera, I installed it from the Ubuntu Software Center. I uninstalled it for now and looking .deb version. But my laptop crashed again so without using Opera...

If I use several browsers, that's because I do some PHP web dev and I sign in on different local (Nginx) websites I develop with different test users having different rights...I was doing the same on Windows 10 with the same browsers. But also, for example, I use Opera for its VPN to change easily the location and test my dev with the PHP libraries/geoip.

After the today crash, my swappiness is now at 10.

 adam@adam-Lenovo-YOGA-720-15IKB:~$ cat /proc/sys/vm/swappiness 10

I use some very cool Gnome extensions and I do appreciate this working environment, I will do my best to keep on using it and not come back to W10!

adam@adam-Lenovo-YOGA-720-15IKB:~$ ls -al ~/.local/share/gnome-shell/extensions
total 24
drwxrwxr-x 6 adam adam 4096 janv. 26 01:19 .
drwx------ 3 adam adam 4096 mars 21 15:47 ..
drwxrwxr-x 5 adam adam 4096 janv. 19 22:51
drwxrwxr-x 5 adam adam 4096 janv. 20 19:46
drwxrwxr-x 3 adam adam 4096 janv. 19 23:30
drwxrwxr-x 5 adam adam 4096 janv. 20 00:21
adam@adam-Lenovo-YOGA-720-15IKB:~$ ls -al /usr/share/gnome-shell/extensions
total 16
drwxr-xr-x 4 root root 4096 août 5 2019 .
drwxr-xr-x 6 root root 4096 janv. 19 03:32 ..
drwxr-xr-x 3 root root 4096 août 5 2019
drwxr-xr-x 3 root root 4096 août 5 2019 

My disk is an SSD, I guess I don't have to check for some bad blocks? Isn't it?

EDIT3

adam@adam-Lenovo-YOGA-720-15IKB:~$ ls -al /var/crash
total 71348
drwxrwsrwt 2 root whoopsie 4096 Mar 19 11:44 .
drwxr-xr-x 15 root root 4096 Jan 20 11:34 ..
-rw-r----- 1 gdm whoopsie 3228635 Mar 19 11:45 _usr_bin_Xwayland.121.crash
-rw-r----- 1 gdm whoopsie 27575267 Mar 19 11:44 _usr_bin_gnome-shell.121.crash
-rw-r----- 1 adam whoopsie 42236551 Mar 17 14:05 _usr_bin_gnome-software.1000.crash
-rw-rw-r-- 1 adam whoopsie 0 Mar 17 14:05 _usr_bin_gnome-software.1000.upload
-rw------- 1 whoopsie whoopsie 0 Mar 17 14:05 _usr_bin_gnome-software.1000.uploaded

These files are available at:

EDIT4

I have put back the swapiness back to 80

I have checked the memory with and hopefully it has been long but it passed successfully of all the 4/4 tests.

I have also disabled Wayland WaylandEnable=false.

It worked fine for 2 days, but on day 3, it crashed on out of sleep mode.

The day after I received a new 8G ram bar, but I had to wait for the delivery of the screwdriver torx t5 to be able to open my laptop! I feel very lucky, not all laptops can accept new ram bar.

enter image description here

It's now working fine for 3 days without any crash. Yet I did a lot of tests using a lot ram, even launching a game from Steam whereas all my usual softwares are running...and no crash.

So I think I can keep on using Ubuntu without changing my habits.

At this time:

adam@adam-Lenovo-YOGA-720-15IKB:~$ free -h total used free shared buff/cache available
Mem: 15G 11G 701M 932M 3.1G 2.6G
Swap: 15G 1.8G 14G

NOTE:When I had only 8G of ram, I launched all my usual softwares and I was swapping, I tried to connect a Bluetooth keyboard (Logitech k810) and it did not work, there was a error message on syslog of out of memory! I quit Firefox to get free ram and could connect the Bluetooth keyboard... I feel like the Linux swap is not some new ram virtualized when that's what I expected from the swap.

5

1 Answer

It looks like you're crashing in zswap...

kernel BUG at /build/linux-hwe-uR14Ux/linux-hwe-5.3.0/mm/zswap.c:1166!

Your BIOS is up to date at version...

Hardware name: LENOVO 80X7/LNVNB161216, BIOS 4MCN33WW(V2.05) 07/19/2018

You've enabled zswap by following the article at this web page.

Reverse your steps and disable zswap...

sudo -H gedit /etc/default/grub # edit this file

remove zswap.enabled=1

sudo update-grub # update GRUB

reboot # reboot the computer

Update #1:

I've reviewed your log files. You have multiple issues causing your crashing problems. We took care of one, with zswap. You have at least two or three more issues.

  • First, for 8G RAM, you have too many open apps/windows. You have three RAM-eating apps open, with Firefox, Opera, and Chrome. Absolutely no reason to do that. That also accounts for some of your high swap usage. Some apps you even have three open windows. Need to close not-recently-used apps/windows, or add more RAM.

  • your snap version of Opera is killing your log files. Uninstall the snap version and install a regular .deb version.

  • did you set your vm.swappiness back to 10? Or is it still at 80 (which would also account for the higher swap usage).

  • you're getting a lot of I/O errors, but it's coming from gnome-shell and sqlite. Strange. GNOME Shell errors are normally a defective GNOME Shell extension. Or maybe you've got a corrupt sql file.

Show me:

ls -al ~/.local/share/gnome-shell/extensions

ls -al /usr/share/gnome-shell/extensions

Update #2:

  • There's no getting away from it, you need more RAM. Add RAM in matched pairs to get the speed advantage of memory interleaving.

  • With only 8G RAM, setting vm.swappiness=10 is wrong wrong wrong. Set it back to default of 60, or 80 like we had it before.

  • And just to make sure that your 8G RAM is working properly, go to and download/run their free memtest to test your memory. Get at least one complete pass of all the 4/4 tests to confirm good memory. This may take many hours to complete.

  • Opera can be downloaded from , or if you create /etc/apt/sources.list.d/opera.list and put deb stable non-free #Opera in it, you'll be able to get automatic updates, and/or use Synaptic to install it.

  • And as much as I know you'll hate to do this, it's necessary, at least for testing purposes... go to and disable these four extensions... (and you MUST restart GNOME Shell, or reboot the system) and see if the system becomes more stable... really... do it... you have too many GNOME Shell errors... and if the system is more stable, only re-enable ONE AT A TIME until you identify the problem extension... I see at least two candidates...



Update #3:

I see a Wayland crash in /var/crash. We want to try and run without Wayland.

Edit /etc/gdm3/custom.conf and...

Change:

#WaylandEnable=false

To:

WaylandEnable=false

Then reboot.

Also, at login, select your username, then click on the cogwheel icon that appears, and make sure you've selected Ubuntu, not Ubuntu with Wayland.

Update #4:

Increased RAM to 16G and set vm.swappiness=60.

19

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy