You are not logged in.

#1 2019-01-19 11:23:26

Yann
Member
Registered: 2017-11-23
Posts: 235

[SOLVED] system hangs when swapping

Hi everyone,

I experience a very annoying memory issue on several laptops. When the system begins swapping it hangs (freeze) and often definitely freezes or breaks the graphical session with lots of errors. I have read lots of posts already talking about that but not solving the issue. So I open a new thread with my personal observations hoping that we will make some progress.

I have an old TravelMate 7730G Acer with arch (4.20.3-arch1-1-ARCH) and i3wm (4.15.0.1-107-g34cf1073) with 4GB of RAM, 12GB of swap logical volume, system and data are logical volumes on an encrypted LUKS partition with a 160GB SSD, swappiness=60. I am very impressed by the behavior of this laptop. Everything works very well, fast, linux compatibility, etc. With this laptop I have no memory issue at all.

I installed Manjaro on a Asus R511LD-XX660H (2015), 4GB RAM, swappiness=60, and begin to observe this memory problem. When the system begins swapping it hangs and freezes. I observed that it needs (I think) to transfer 1 or 2 GB from the RAM to the swap making the system to totally freeze during minutes. My old Acer laptop doesn't have this behavior and never really slow down that is very pleasant. The manjaro system is on normal partitions (no LVM, no encryption).

For some reasons I needed to get more power, I got a few weeks ago a Dell XPS 15 9570 (YES!!). I built an arch USB drive with the same characteristics that my Acer system, arch (4.20.3-arch1-1-ARCH) and i3wm (4.15.0.1-107-g34cf1073), 3GB of swap logical volume, system and data are logical volumes on an encrypted LUKS partition. When I boot on the usb drive with the Dell XPS 15 (8GB RAM) I observe the same memory issue. However when I boot on my old Acer there is no memory behavior problem (to double check). For example I can not compile vivaldi-widevine through yaourt without several 15mns total hangs before crashing the graphical session. Trying added swapspace, 10GB of swap file manually, etc. Every time it looks to fill the 8GB of RAM too fast and freezes when swapping. Result, I can not install vivaldi-widevine on the Dell XPS 15 without never having any problem on my old old Acer.

This memory behavior is very annoying because makes the system very slow and all the time freezing when having only 4GB of RAM and often definitely freezes or breaks the graphical session with lots of errors. I tried to change for files swap, came back to partition swap and tried the swapspace package. Still the same issue.

So.. I read that this could be related to LVM encryption. However, here I observe the same issue without LVM encryption (Manjaro on Asus) and I don't get the problem on my old Acer with LVM encryption.
I have this issue on two laptops on three. The main differences I see are:
The two having the issue are UEFI against BIOS for the Acer and the hardware is older for the Acer ...

My guess would be that the linux kernel can not implement some features for the Acer because of its old hardware and these more complex memory management features are applied for the 2 laptop having the issue.

So, what do you think? Could be a kernel behavior management memory issue/even bug? And is there a more advance way to customize the linux kernel parameters without having to recompile it every time? Some files to edit?

Thanks for your time.

Last edited by Yann (2019-01-20 14:35:37)


all different - all equal

Offline

#2 2019-01-19 12:56:01

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [SOLVED] system hangs when swapping

I'm hazarding a guess that you have an explicit on disk mount point for /tmp on your older system and not on the newer systems. /tmp defaults to a tmpfs which lives in your RAM and is half the RAM's size. If you use a default configuration of yaourt it will build AUR packages in /tmp huge packages will easily fill up that tmpfs, and your RAM and start to swap.

Offline

#3 2019-01-19 13:38:00

Yann
Member
Registered: 2017-11-23
Posts: 235

Re: [SOLVED] system hangs when swapping

Thanks V1del for the reply.

This is my old acer mount config.

Filesystem                   Size  Used Avail Use% Mounted on
dev                          2.0G     0  2.0G   0% /dev
run                          2.0G   39M  1.9G   2% /run
/dev/mapper/lvmsysvg-system   56G   48G  4.9G  91% /
tmpfs                        2.0G   77M  1.9G   4% /dev/shm
tmpfs                        2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda1                    190M  153M   23M  88% /boot
tmpfs                        2.0G  8.0K  2.0G   1% /tmp
/dev/mapper/lvmsysvg-data     79G   64G   11G  86% /mnt/data
tmpfs                        394M   12K  394M   1% /run/user/1000

The manjaro system also have this line

tmpfs                          2.0G  8.0K  2.0G   1% /tmp

When I install large packages I before run:

mount -o remount,size=8G /tmp/

I did it every time on my new system. I think this is different than the memory behavior..

Any idea?


all different - all equal

Offline

#4 2019-01-19 15:09:51

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,794
Website

Re: [SOLVED] system hangs when swapping

I observed that it needs (I think) to transfer 1 or 2 GB from the RAM to the swap making the system to totally freeze during minutes.

Swap is not "free ram", you can't transfer everything from ram to swap. You are actually running out of RAM and your system starts thrashing. And then OOM killer kicks in and probably kills your X


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

#5 2019-01-19 15:25:29

Yann
Member
Registered: 2017-11-23
Posts: 235

Re: [SOLVED] system hangs when swapping

Ok for the OOM killer killing X.

What do you mean by thrashing?
Any idea about the memory behavior I described?

(btw, interesting your webstite ...)


all different - all equal

Offline

#6 2019-01-19 15:29:13

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,794
Website

Re: [SOLVED] system hangs when swapping


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

#7 2019-01-19 15:33:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [SOLVED] system hangs when swapping

Check your yaourt configuration you most likely switched that to not be in the tmp directory by default. Or even better to rule out an issue here simply build the package in question in some local directory with makepkg, check your dmesg if there are any messages on whether the OOM killer is triggered when running out of RAM and starting to swap.

FWIW you might also want to post a terminal output from an attempted build from both your old and new system (also not the manjaro system but your dell system, we don't care about manjaro).

Offline

#8 2019-01-19 15:36:10

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,794
Website

Re: [SOLVED] system hangs when swapping

I forgot about this thread https://bbs.archlinux.org/viewtopic.php?id=231265
Something to ponder about...


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

#9 2019-01-19 17:07:24

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: [SOLVED] system hangs when swapping

There're multiple reports suggesting that swap space on an LVM volumes causes stalls, see eg. https://bbs.archlinux.org/viewtopic.php?id=231083
Building chromium and derivates on anything w/ less than 16GB RAM (free! real! RAM, not SWAP, not RAM taken by running browsers, your DE, …) is sheer masochism - it's just that demanding (yes, sucks)

Offline

#10 2019-01-19 17:48:45

Yann
Member
Registered: 2017-11-23
Posts: 235

Re: [SOLVED] system hangs when swapping

Ok for thrashing, thanks.

I think I haven't touched to the yaourt configuration. When I start the vivaldi-widevine install through yaourt it breaks if I don't increase the size of the /tmp partition first by running:

mount -o remount,size=8G /tmp/

So I think it is well using the /tmp partition. No?

V1del wrote:

you might also want to post a terminal output from an attempted build from both your old and new system

I have no problem when installing/compiling vivaldi-widevine on my old acer system and it represents more or less 3 hours of compilation (lots of outputs). For the other it just freezes totally as described. But I can run it with the output in a file, yes. However, I think this has nothing to see with the issue. The vivaldi-widevine install is just an example of the memory behavior when it comes OOM. Same thing with a powerful process or too much tabs opened with a browser.

Hi seth, always present to help. I have already seen the thread you mention with your comments and the conclusion. However, as I said I don't have any issue with memory with my old acer set with LVM encryption. Moreover I built a USB drive with the exact same system (LVM encrypted) and I get no problem when booting up on my acer with it and I get the memory issue when booting up on the Dell XPS with it. Nothing to see with linux kernel features regarding host hardware?

I repeat, I have the same arch system on my old acer and on the Dell XPS and on the USB drive I built and I have a perfect memory behavior on the acer and it's hanging/freezing on the Dell XPS.

I am very annoyed with this memory behavior and don't know what to do to get a "normal" (regarding my old acer) swapping behavior on my new Dell XPS.


all different - all equal

Offline

#11 2019-01-19 20:13:03

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: [SOLVED] system hangs when swapping

Might be IOMMU related (wild guess), would be an interesting finding.
What's lscpu for the different devices?

Offline

#12 2019-01-19 20:28:26

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: [SOLVED] system hangs when swapping

Please post the journal for one boot of an arch installation that ends in a lockup.

Offline

#13 2019-01-20 14:34:33

Yann
Member
Registered: 2017-11-23
Posts: 235

Re: [SOLVED] system hangs when swapping

Sorry for the late answer. I performed lots of tests. I reinstalled the system without LVM neither encryption on the Dell XPS and the memory management was good, very fast. Then I reinstalled the system step by step with LVM encryption like before and now the memory management works well. I don't know why I did have this issue. But finally now it works normally with and without LVM+encryption. So it's SOLVED.

Thank you so much for all your help.


all different - all equal

Offline

Board footer

Powered by FluxBB