The solution is already there - it's called zram and does away with storage based swap entirely. Instead the system compresses RAM to a RAM based virtual swap - if that then fills beyond the parameters set the OOM killer kicks in. I know Pjotr doesn't recommend it based on some testing experience a good few years ago, but I've used it for a couple of years now trouble free on both memory poor and memory OK hardware - it's the only thing that makes the memory poor hardware usable, e.g I can run Manjaro Cinnamon on an old 2GB RAM chromebook with reasonable performance, no complete freezes albeit it can lag a little bit whilst the (also underpowered) CPU is busy compressing/decompressing RAM. My main 8GB RAM laptop just works, always.Marie SWE wrote: ⤴Thu Jun 09, 2022 11:16 am The solution is to develop a special kernel for desktop use to handle memory and swap in another way that are more desktop friendly. and that will not happen as Linux desktop is just a little tiny niche of users and it's not worth the time to develop two different kernels.
It is now the default out of the box set up for some distros, most notably Fedora. ChromeOS (which is just a modded Gentoo) has always used it.