pupswap behavior

Moderators: 666philb, Forum moderators

Post Reply
geo_c
Posts: 2509
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1804 times
Been thanked: 709 times

pupswap behavior

Post by geo_c »

I'm posting here because I'm using fossapup, but it may be more a general pupswap question.

I ususally set up a pupswap file just in case some application gums up the ram, but on an old Dell Inspiron i5 laptop that I have with 3.65GB of usable ram, mounting the pupswap seems to cause the machine to use the swapfile when it doesn't appear to need to do so, which causes major lags in keyboard and mouse response.

I was doing a lot of file copying from midnight commander, and so I monitored the system using HTOP while trying to use other applications during the copy process. Basically HTOP reports very low CPU and RAM usuage, the RAM being somewhere around 1.5-2gb full at any point and a good 1-1.5gb still free. But the swapfile is swapping in 6-20mb at a time, causing the system to sporadically lag.

Unmounting the pupswap solves the issue. But it makes me wonder:

Is using a pupswap file really beneficial at all? Presumably it keeps the system from crashing in a pinch, but at what point does the system decide it needs to cache to the swap?

Last edited by geo_c on Fri Sep 02, 2022 9:32 pm, edited 1 time in total.

geo_c
Old School Hipster, and Such

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: pupswap behavior

Post by williams2 »

Is using a pupswap file really beneficial at all?

If using swap space causes the system to slow down a lot, so much that it unusable or almost unusable,
then no, using a pupswap file is not really beneficial at all?

It can be very usful in certain situations.
For example, downloading large files using the Mega plugin in Firefox seems to download the file completely to ram, then ask what name and where you want to save it.
Swapspace allows you to increase the effective space in ram Firefox can use, so you can download larger files than you could without swapspace.

I have run Puppy with a 256MB swapfile, and it would not use any space for days or weeks.
And then, for some reason, one day, it used about 100MB

You can set the swapiness kernel parameter. Search the internet for swappiness

The kernel has a OutOfMemory killer, but it does not work well.
See earlyOOM https://forum.puppylinux.com/viewtopic.php?t=2980
With EarlyOOM, Puppy has never slowed down or crashed because of a lack of ram.

I have been using this to run earlyoom:

killall -q earlyoom ; earlyoom -r0 -m1 --avoid 'Xorg' &> /tmp/yoom.log & disown

geo_c
Posts: 2509
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1804 times
Been thanked: 709 times

Re: pupswap behavior

Post by geo_c »

williams2 wrote: Fri Sep 02, 2022 6:04 pm

You can set the swapiness kernel parameter. Search the internet for swappiness

Here's a detailed explanation of swapiness: https://www.howtogeek.com/449691/what-i ... change-it/

geo_c
Old School Hipster, and Such

LateAdopter
Posts: 110
Joined: Sat Aug 15, 2020 5:10 pm
Been thanked: 17 times

Re: pupswap behavior

Post by LateAdopter »

Dimkr's Woof-CE builds have zramswap configured in rc.sysinit. It causes mouse lag and GPU hangs on my Intel box.
It's possible to remove it from a running system with:

Code: Select all

swapoff /dev/zram0
zramctl -r /dev/zram0

But it loads before Xorg so it could interfere with the initialisation of the display driver stack. I comment out the sections in rc.sysinit so that it doesn't get loaded.

User avatar
bigpup
Moderator
Posts: 6338
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 746 times
Been thanked: 1308 times

Re: pupswap behavior

Post by bigpup »

How to configure swappiness in puppy
https://oldforum.puppylinux.com/viewtopic.php?t=100219

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

dimkr
Posts: 1964
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 37 times
Been thanked: 876 times

Re: pupswap behavior

Post by dimkr »

LateAdopter wrote: Sat Sep 03, 2022 12:33 pm

It causes mouse lag and GPU hangs on my Intel box.

How much RAM do you have? What GPU is it? Is it a Bluetooth mouse?

LateAdopter
Posts: 110
Joined: Sat Aug 15, 2020 5:10 pm
Been thanked: 17 times

Re: pupswap behavior

Post by LateAdopter »

It has 4GB RAM of which the integrated GPU in my extremely feeble Braswell N3150 takes 1.5GB

I normally use my Logitech K400+ proprietary wireless connection to its dongle. It's seen as a generic USB mouse and keyboard in the BIOS and until it's recognised as Logitech by linux. Then the I2C_HID and Logitech drivers get loaded. I have tried one of your builds with a PS/2 keyboard and USB mouse but it didn't change anything.

A previous problem with compression was related to the fact that it only has 256k L2 cache per core and no L3 cache.

I asked about zram swap on cagepup a3 and I wasn't expecting you to do anything about it. I just mentioned it here in case someone hits the same problem.

User avatar
bigpup
Moderator
Posts: 6338
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 746 times
Been thanked: 1308 times

Re: pupswap behavior

Post by bigpup »

Swap is set by default to start being used at 60% RAM still free or something close to that. (depends on Puppy version)

Use the info, in the topic I posted earlier a link to, set this to a lower point, to start using swap.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

dimkr
Posts: 1964
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 37 times
Been thanked: 876 times

Re: pupswap behavior

Post by dimkr »

LateAdopter wrote: Sat Sep 03, 2022 4:55 pm

A previous problem with compression was related to the fact that it only has 256k L2 cache per core and no L3 cache.

Can you share the output of for i in /sys/devices/system/cpu/cpu0/cache/index*/size; do echo "$i:`cat $i`"; done? I can disable zram on CPUs without L3 cache.

User avatar
bigpup
Moderator
Posts: 6338
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 746 times
Been thanked: 1308 times

Re: pupswap behavior

Post by bigpup »

May want to use this program.

Swapfile Manager
https://forum.puppylinux.com/viewtopic.php?t=6735

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

LateAdopter
Posts: 110
Joined: Sat Aug 15, 2020 5:10 pm
Been thanked: 17 times

Re: pupswap behavior

Post by LateAdopter »

dimkr wrote: Sun Sep 04, 2022 9:15 am
LateAdopter wrote: Sat Sep 03, 2022 4:55 pm

A previous problem with compression was related to the fact that it only has 256k L2 cache per core and no L3 cache.

Can you share the output of for i in /sys/devices/system/cpu/cpu0/cache/index*/size; do echo "$i:`cat $i`"; done? I can disable zram on CPUs without L3 cache.

/sys/devices/system/cpu/cpu0/cache/index0/size:24K
/sys/devices/system/cpu/cpu0/cache/index1/size:32K
/sys/devices/system/cpu/cpu0/cache/index2/size:1024K

Post Reply

Return to “Fossapup64”