|
|
Subscribe / Log in / New account

Multi-generational LRU: the next generation

Multi-generational LRU: the next generation

Posted May 25, 2021 12:05 UTC (Tue) by k3ninho (subscriber, #50375)
In reply to: Multi-generational LRU: the next generation by comicfans
Parent article: Multi-generational LRU: the next generation

>while using windows, I've never seen system hang due to high memory usage, but such problem can easily makes linux "hang": gui/terminal not respond to any key in reasonable time/ ssh timeout ,you can't kill bad app, anything you're doing just makes it slower. you may wait it for hours (or forever) to restore, or just hard reset. I've hit such problems multi times.
Windows XP and spinning rust used to grind to a halt on heavy memory use, and Win10 puts a device out of action for hours upgrading and patching itself if you still have a rotating hard disk.

That's more about the latency of storage access. What is the current advice about RAM and swap? I ask because, since having NAND-based SSD's with block overwriting concerns, I've disabled swap and bought large amounts of RAM so that apps can't get stroppy about memory pressure. Only recently have I configured zswap but it's not noticeably changed my experience.

I think that this is something that should involve running user-experience items at elevated nice levels and using the alt-sysrq keys to safely OOM-kill and then unmount filesystems if you can't recover the device.

Are we still advocating for swap in 2021?

K3n.


to post comments

Multi-generational LRU: the next generation

Posted May 25, 2021 14:41 UTC (Tue) by comicfans (subscriber, #117233) [Link]

>Windows XP and spinning rust used to grind to a halt on heavy memory use

maybe I'm lucky, I haven't hit XP halt even once with celeron1.7 + 845G + 256RAM + HDD . IIRC, I've run many apps which definitely exceeds 256MB, it got slower, but never stop responding.

>and Win10 puts a device out of action for hours upgrading and patching itself if you still have a rotating hard disk.

we all know windows update isn't good, but we're talking about high memory pressure, not a bad system update.

>I've disabled swap and bought large amounts of RAM so that apps can't get stroppy about memory pressure. Only recently have I configured zswap but it's not noticeably changed my experience.

it doesn't apply if laptop have none-replacable ram. and memory leak (maybe by accident) can eat as much ram as you have. of course better hardware can resolve many software problems, but should it stop kernel improve experience on old hardware ? while slower-bigger storage is still cheaper than faster-smaller storage, swap is always needed (that's why bcache/lvm-cache exist)

Multi-generational LRU: the next generation

Posted May 25, 2021 17:30 UTC (Tue) by MattBBaker (guest, #28651) [Link]

I would argue the opposite. With disk space as fast and cheap as it is now, why not have a 1:1 mapping between swap and RAM with /proc/sys/vm/swappiness set to 100? With a kernel that believes in over committing memory, being able to blow away the entire working set in an instant is a positive. My QoL has vastly improved on my linux workstation after I give it gobs of swap, since I no longer worry about it thrashing a tiny swap file as the OOM killer desperately looks for an alternative to firefox to knife.

Multi-generational LRU: the next generation

Posted May 28, 2021 18:17 UTC (Fri) by anton (subscriber, #25547) [Link] (1 responses)

My recommendation is to have no swap if the backing device is a HDD. Why? If the system needs so much RAM that it starts swapping, it becomes unusable anyway.

With an SSD, swap may be more viable. And if you swap rarely, don't worry about the limited number of SSD writes possible. If you swap often, buy more RAM.

Multi-generational LRU: the next generation

Posted Jun 10, 2021 11:46 UTC (Thu) by Hi-Angel (guest, #110915) [Link]

I have 2 comments for this thread, both regarding HDD and SSD.

First, for HDD: I'm the guy who posted the testimonial that the v3 of the patches refers to, and I am using HDD. So, just in case anyone's wondering about behavior on HDD specifically, here it is.

Second, for SSD: I see here an attitude that once you create a SWAP on SSD, all problems are gone. So here's my experience: this is not true.

My gf has a Macbook 2013 with SSD, 4G RAM, ZSWAP. She always had swap-partition on the SSD. Before I went out to try the patches on her laptop, she have also had frequent SWAP-storms, her overall experience was pretty bad.

After I configured her system to use the multi-LRU patches (v2), her experience improved a lot. Now the only moment when lags start appearing is when her SWAP usage goes to around 7-8G (Idk why exactly that size).

So, for anyone out there thinking creating a SWAP on SSD will magically solve any need in the memory reclaim rework — that ain't true.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds