Page MenuHomeSolus

Make it possible to use zswap (for machines with little RAM)
Closed, WontfixPublic


I'm working with large code bases on a 8GB RAM notebook. It works with a swapfile but the performance impact is noticeable (as in machine close to stops responding at times). I've noticed the task about enabling zram and I'd like to add zswap to be considered as an alternative.

Relevant forum post:
Relevant zram ticket: T316

Event Timeline

sankasan created this task.Jun 19 2018, 8:25 PM

@JoshStrobl zswap and zram are two different technologies. Closing this as a dupe isn't technically correct.

Quoting the zswap wikipedia page:

One of the alternatives to zswap is zram, which provides a similar but still different "swap compressed pages to RAM" mechanism to the Linux kernel.

sankasan reopened this task as Open.Jul 29 2018, 4:57 PM
DataDrake triaged this task as Needs More Info priority.
DataDrake added a subscriber: DataDrake.

Can someone point me to a benchmark for zswap?

moriel5 added a subscriber: moriel5.EditedNov 6 2018, 11:40 AM

I'd be glad to benchmark both zram and zswap, how do I go about it?
I could try using the Phoronix Benchmark Suite's memory test, as well real-life tests such as opening and using multiple memory intensive apps at the same time.

I personally think that this could also be a huge boon to low-end Chromebooks as well (and also for old PCs, such as the Dell Inspiron Mini 1018 and the Dell Dimension 4700).

DataDrake closed this task as Wontfix.Feb 14 2019, 12:50 AM

Closing due to lack of inactivity. If someone can provide any meaningful benchmarks, I will look again.

Closing due to lack of inactivity. If someone can provide any meaningful benchmarks, I will look again.

As I had said, I'm willing to test this.
I just need to know how.

foxium awarded a token.Apr 1 2020, 6:55 AM
foxium added a subscriber: foxium.
Pilleo added a subscriber: Pilleo.EditedSep 18 2020, 10:05 PM

@DataDrake Does this look meaningful enough?

This comment was removed by Staudey.

@Pilleo that seems to be a benchmark for zram, not zswap

They are both about compressing memory, so I believe results should be rather close

mrdaltro added a subscriber: mrdaltro.EditedAug 17 2021, 6:09 AM


Basic research and we sure can find a lot of resource about the performance improvement zswap can be (I'm listing it below). If devs are afraid, remember Linux is a modular highly customizable system. Not just zswap, but even zram (!) is default in Fedora for more than a year right now, what I think it's not desirable, as I think zswap is a better alternative (some data it's really meant to be stored in mass storage, even in runtime, the exception is for memory pressure situations as I'd like to state), as it's really polished Linux feature, it's in there for years (since Linux 2) and it's the default (enabled by default) for the official/mainline stable Linux image currently (and for a lot of Android devices right now, and as an example I could say even my device Asus A001D, but I know about a lot of Xiaomi phones also). I see the purpose of having a kinda "stripped down" kernel, but sure just one or two modules wouldn't have great impact for image's size.

The sources

"As you can see, this workload shows up to a 40% performance improvement in some cases after the heap size exceeds available memory when zswap is enabled, and the POWER7+ results show that the hardware accelerator can improve the performance by up to 60% in some cases compared to the baseline performance."
You can see graphs in:

This one is from Linux 2.6 (!), a lot of years ago and even that times 30% less compilation time was observed using zcache (older name for zswap, in older Linux versions). One could say "oh, but now we all can get a lot of RAM, is so cheap". Yea, it's really cheap for someone that lives in a rich country, but it's almost blasphemy to say RAM is cheap where I live and in a lot of other poor countries (and that's one of the reasons for MATE version being made, right?). So, yeah, we need to compress our RAM to work (that's almost the main reason I did leave Solus time ago btw).

"The results of a kernel building benchmark indicate a runtime reduction of 53% and an I/O reduction 76% with zswap vs normal swapping with a kernel build under heavy memory pressure (see Performance section for more)."

Ofc responsiveness is debatable stuff, it ofc relays on hardware, on CPU extensions and capacities. With a Haswell i3 I can see improve of responsiveness, like that guy found with his Raspberry Pi, but sure maybe an older CPU would suffer drawbacks and well, that's why I'm suggesting it to be available as module; there'd be no reason (or benefit) to enable zswap in a Pentium 4; however, this could be really useful in older 2014> laptops or low-mid budget computers with low ram (<8gb) (for our current standards).

Extra material:
Memory pressure is a real concern for people that can't upgrade hardware. I was thinking about try out Solus again, then I remembered this big con, that isn't findable in Debian, Arch, Ubuntu, Slackware, Gentoo, Void, Clear... well, I think it's really an only-Solus decision to not even include it as a module, as an option to the user (specially those that live in poor countries, what I think it's remarkable), while there's even years of using it in some stable known distros like CentOS and a lot of kinda 'end-user' implementations as zswap automation scripts using systemd or not.

Well, I hope I have said what I wanted to say.