upvote
zswap works very differently to zram.
reply
Because it is a user choice, and there are applications where it is inappropriate. For desktop Linux it should probably be on, as long as its clear to the user - but yeah, for many other Linux use cases its inappropriate.
reply
“Because it is a user choice”

That’s true of everything. Default setups make those choices.

reply
Maybe it should generally be on and and only switched off when it is inappropriate.
reply
Maybe it should be generally on for desktop-focused distros and generally off for server-focused ones. The distros that focus on doing both well might want to recommend it in the installer when told it's primarily a desktop installation and explain the tradeoffs.

For a server, it really depends on what kind of service you're providing whether it would be helpful. We might want to let server admins, SREs, production engineers, or platform engineers to make an active decision about it.

reply
I have a hard time imagining cases where swapping or running out of RAM is preferable to RAM compression.
reply
In most cases you'll really want zswap rather than zram anyway.

There are plenty of scenarios in which servers are run with only nominal swap sizes or none at all and systems don't run out of RAM.

Let me size my hypervisor cluster to demand and let the system decide where to place the guests. If the hypervisors are crashing due to full RAM, that's down to planning or budget issues and not a reason to put additional unpredictable latency underneath the guests.

Let me size my SDI to UDP TS video streaming servers to the number and size of streams they'll service. There's not much in their memory pages that's going to ever be idle enough to compress, so why boot the kernel configured to do that? It's just risking extra packet IAT for buying not much benefit.

But in general, yes, zswap would be a good thing compared to swapping to a drive, unless you are mostly swapping things that are really truly idle a long time. Default swappiness on a lot of distros is around 60 by the way, and on servers it's often set closer to 10 or 15.

reply