114
submitted 6 days ago* (last edited 6 days ago) by Die4Ever@retrolemmy.com to c/linux@programming.dev

The graph is on a logarithmic scale btw

Configuration Before series (ms) With series (ms)
1 vCPU 22.3 (21.6-22.6) 0.97 (0.72-1.4)
8 vCPUs 314 (97-2542) 7.0 (5.0-98)
top 41 comments
sorted by: hot top new old
[-] thingsiplay@lemmy.ml 16 points 6 days ago

How does this affect us in real world usage? I know "lower number is better", but I have no understanding how this affects. I don't understand what exactly is measured here. Could someone explain it to me? Is this the read and write time of each file / block? I think with a huge enough system RAM, the swap file wouldn't be used much anyway, so there shouldn't be much of improvement for most people.

Could someone help me to understand this?

[-] Die4Ever@retrolemmy.com 14 points 6 days ago

Well it could potentially reduce stutters in games when your RAM is full. I think most people don't use Zswap, but honestly they should! It's really good ( @victorz@lemmy.world wanted to know too)

[-] thingsiplay@lemmy.ml 7 points 6 days ago* (last edited 6 days ago)

Thanks. I'll read more about it, starting at https://wiki.archlinux.org/title/Zswap and https://en.wikipedia.org/wiki/Zswap (interestingly the Archwiki result was the top result). From Wikipedia:

Instead of moving memory pages to a swap device when they are to be swapped out, zswap compresses them and then stores them in a memory pool dynamically allocated in the system RAM. This way, writeback to the actual swap device is deferred or even completely avoided, resulting in a significantly reduced I/O load for systems that require swapping; the tradeoff is the need for additional CPU cycles to perform the compression.

To me, this sounds like its the opposite of full RAM. It tries to avoid writing to swap file, if I understand it correctly. Or bundle them up to write a huge chunk only once, like filesystem do on hard drives or SSDs in example, to reduce writing each single block. Do I understand it correctly? So one would need a huge amount of system RAM to have this work effectively. I have 32gb RAM and practically never fill it up when playing a game, usually. So maybe its worth exploring this option. Overall seems like most people with their current setup aren't affected by this Linux update.

[-] Die4Ever@retrolemmy.com 14 points 6 days ago* (last edited 6 days ago)

So it basically makes a fake swap space in your RAM and that section is compressed. Linux still treats it as swap space so it only writes to it when you're low on RAM (or there's better things that could be cached in RAM even when it looks like your RAM is mostly empty it can still cache frequently accessed data from your disk). Zswap tries to store most swap in the compressed section of RAM, but when something doesn't compress well or when there's just too much stuff for RAM, it will write to the swap on disk.

So one would need a huge amount of system RAM to have this work effectively.

No, it's good for all sizes of RAM. If you have really small RAM, Zswap can actually be essential because without it you would be reading/writing to disk swap too much and performance would suffer. Someone got Linux running on a Switch Lite, just 4GB of RAM with full desktop and Steam too, and they said "With only 4 GB of RAM, zswap is basically mandatory here"

I have 32gb RAM and practically never fill it up when playing a game, usually.

Zswap would probably still improve performance for you, but it might not be a noticeable difference. But it will reduce your SSD writes, so that's nice to improve SSD lifetime a bit.

This is a very technical article about zRAM and Zswap https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html (I think his tone is overly harsh on zRAM, zRAM can be great if the computer has a slow spinning rust hard drive)

a little less technical https://easylinuxtipsproject.blogspot.com/p/speed-mint.html#ID2

[-] thingsiplay@lemmy.ml 4 points 6 days ago

Thanks that is a bit more enlightening. I'll read the given link and other source today, to get more into. Especially if it helps avoiding writes to SSD, as I got burned very hard from wearing down SSD (it was a software bug that lead to it). I guess the performance difference and the amount it saves from SSD rewrites shouldn't be too much to be worried about, but it bugged me so much that I will take this into consideration nonetheless.

Guess I learned something new today. :-)

[-] victorz@lemmy.world 3 points 6 days ago

But it will reduce your SSD writes, so that's nice to improve SSD lifetime a bit.

This, assuming you have a swap partition, right? I'm running with 64 GB without any swap. No issues while gaming AAA titles. Without swap there should be no wear on the SSD, right?

[-] thingsiplay@lemmy.ml 4 points 6 days ago

Here is an article In defence of swap: common misconceptions by Chris Down from 2018. It has a "tl;dr" section with 7 points, if you just want have a quick look.

I setup a swap file instead a partition, it's just more flexible, but same concept. The swappiness settings cat /proc/sys/vm/swappiness is at "60" with a total size of 64 GiB on a very fast NVME SSD. If this was a slow HDD, then any writes and reads would be much more noticeably slow. I had it disabled in the past too and didn't notice any difference. The only difference to me would be, if the system RAM fills up, then the system could freeze and maybe crash. Or the system will unload applications to make room, and it could hit randomly an important app. Imagine a program has a memory leak.

[-] Die4Ever@retrolemmy.com 4 points 6 days ago* (last edited 6 days ago)

If you really don't want any swap then you can use zRAM. I've heard even just a little bit of swap space (even zRAM) can help a lot. Note that when you set up zRAM, if you set it to 16GB that does not mean it will cap at 16GB of RAM usage, it means it will cap at 16GB of data pre-compression and its actual RAM usage will likely be closer to 6GB when full. And when it's empty it doesn't use any RAM.

[-] victorz@lemmy.world 1 points 6 days ago

That sounds great. I'll keep that in mind when I reach the point where my large RAM size becomes obsolete. πŸ™

[-] fozid@lem.radiantfig.fyi 2 points 6 days ago

Gaming isn't heavy on ram. You need fast ram not lots of ram for gaming. Lots of ram helps with heavy workloads, compiling and software development and stuff. Playing a game only needs the recommended amount for that game, then as fast as you can get so as not to be a bottleneck for your CPU.

[-] victorz@lemmy.world 1 points 6 days ago

Alright, well, that's not really addressing the question. Without a swap partition, you shouldn't get much wear on your SSD, right?

[-] fozid@lem.radiantfig.fyi 2 points 6 days ago

Sorry, I may have misunderstood. No, if you don't use your SSD as a swap device, you won't use or wear your SSD with swap. With 64gb ram and just playing AAA games, you won't have much need for any kind of swap. If you decide to do any heavy workloads that are heavy on ram requirements, zswap is an option to keep swap off your SSD and thus prevent wear on the disk. However if you are very limited on ram for your workload, zswap might not provide enough space, then traditional SSD swap will be the final option.

[-] victorz@lemmy.world 2 points 5 days ago

Okay cool, thank you πŸ˜ŠπŸ™

Sorry

No worries, I think maybe I came off a little bit annoyed, which I assure you I wasn't. 😁

[-] victorz@lemmy.world 4 points 6 days ago

I find it slightly counterproductive that this is a countermeasure against swapping to disk/"device":

You want to avoid swapping, which happens when RAM is full (right?), so you create a really fast operating swap thing in RAM, reducing the amount of operational RAM, thus inducing more swapping because there's "less" "RAM".

Not to mention that the data is just moving from place to place inside RAM, just as it would've been sitting there before anyway. The only difference is the compression, I assume? Which is the main benefit? Otherwise it just feels like unnecessary shuffling of data back and forth.

[-] Die4Ever@retrolemmy.com 3 points 6 days ago* (last edited 6 days ago)

In terms of performance, you actually don't want to avoid swapping, you want your OS to be smart about swapping. Some type of swap space is probably always beneficial unless you have more RAM than storage lol. Swap is great for putting aside data that isn't needed but can't be freed, and prioritizing filesystem cache over some background service that isn't doing anything. Even big servers often use some form of swap because swap can reduce disk reading. In some cases swap can even reduce disk writing, as counter intuitive as that sounds.

Yea both zRAM and Zswap use good compression, typically around 3:1 ratio, and it's still light on CPU usage, much faster than SSD swap.

[-] victorz@lemmy.world 1 points 4 days ago

I remember when I used to have swap enabled. It used to be very slow, back in the days when we used swap in mechanical drives. The computer would just freeze for a second while swapping, lol.

So I'm having some trouble wrapping my head around why swapping would not be something you want to avoidβ€”why it would be beneficial for performance. If you can prevent the need for swapping, that's the best outcome, surely? The only solution to which would be to have enough pure RAM installed in the system.

But I think I get you? You mean you "want" to swap when the memory runs out?

[-] Die4Ever@retrolemmy.com 0 points 4 days ago

If you can prevent the need for swapping, that’s the best outcome, surely?

It's more complicated than that. If stuff in your disk needs faster access than old unused stuff in memory, swap can make the swap so that the stuff in your disk is cached better in memory. If you were able to cache your entire filesystem into RAM then your computer would be faster, but people don't have that much RAM.

[-] fozid@lem.radiantfig.fyi 2 points 6 days ago

That's not how it works but yes, if you don't need to swap, then that is better. Avoiding swapping though is also the wrong angle as depending on amount of ram, swapping can be beneficial, it just depends.

[-] victorz@lemmy.world 1 points 6 days ago

That's not how it works, but I'm right? I guess I just don't get it at all. πŸ˜… Which just makes it all the more interesting I suppose. πŸ˜ƒ

[-] fozid@lem.radiantfig.fyi 3 points 6 days ago

Yeah, there is a lot to it. Firstly, if you have loads of ram, and don't really use it, then discussing swap is pointless, just don't have a swap device. If ram on your system is marginal for your workload, then swap is a must have as your system will gain performance by being able to swap, even if it is to an SSD. In that case your system will start swapping to ssd as it gets closer to being full. Zswap improves this by using the margin the system has in ram at which it would swap, to compress the pages in ram instead. So you don't lose any usable ram with zswap. But you gain performance as compressing the pages in ram is faster than writing them to SSD. But it does eat some CPU load in doing this.

[-] victorz@lemmy.world 1 points 5 days ago

Ah, okay. I get it, I think. You're still using the same amount of RAM but you're spending some CPU cycles compressing its contents to make more room.

Can you combine zswap with regular swap, like a swap device or swap file?

[-] Die4Ever@retrolemmy.com 2 points 5 days ago* (last edited 5 days ago)

Zswap always(?) uses a swap file or disk partition. It does a smart job using both compressed memory and disk space as swap

zRam does not use disk. Do not attempt combining zRam with any kind of swap on disk, it's a horrible combination

[-] victorz@lemmy.world 1 points 5 days ago

Oh okay, so zswap actually requires a swap file or device? Or just uses it if available?

[-] Die4Ever@retrolemmy.com 2 points 4 days ago

I think it might require it, but I've never tried it without.

[-] victorz@lemmy.world 1 points 4 days ago

Thanks for all your info, friend. I appreciate it.

[-] thingsiplay@lemmy.ml 2 points 6 days ago

To me the compression sounds like it would increase RAM (virtually speaking), without hitting performance too much. Otherwise it would use the SSD and io is generally much slower than RAM operations (and compression, decompression in memory only if its fast like this one). When I understand the benefit correctly.

[-] victorz@lemmy.world 2 points 5 days ago* (last edited 5 days ago)

Yeah I think I understand, too. You're increasing the swapping by introducing an area in RAM that is no longer usable as regular RAM, but you're also compressing, which "increases" the available RAM, so to speak. πŸ˜… At the cost of CPU of course.

[-] victorz@lemmy.world 3 points 6 days ago

Thank you!

Okay cool. I might look into it when 64 GB DDR5 becomes too little, sometime in the future. πŸ˜…

[-] victorz@lemmy.world 5 points 6 days ago

I'm also interested.

[-] BagOfHeavyStones@piefed.social 10 points 5 days ago* (last edited 5 days ago)

Nice.

My machine has only 8gb of ram. Since I use a lot of Gmail, chrome and other tabs (WhatsApp, Google messages) I often ended up swapping and getting really bogged.

With zram, all the code on those tabs is usually quite squash able, so rather than the delay of swapping to SSD, it swaps into 'compressed ram'.

Sure it's not great, but my computer is more stable with 4g zram than with 8g and real swap.

[-] diaphragmwp@discuss.tchncs.de 8 points 6 days ago

Amazing! My 2 GB phone would have really benefited from this in running a webshit browser. If only Android wasn't a piece of shit to build and actually followed Linux development sometimes. But then it probably also wouldn't have any issues at all with 2 gigs, that or the browser would get bloat enough for this to be an issue again.

[-] hexagonwin@lemmy.today 1 points 5 days ago

i use zram on a 3.x kernel on my ancient android phone. it helps significantly! modern firefox is unusable without zram.

[-] diaphragmwp@discuss.tchncs.de 1 points 5 days ago

Yes, but did you back port the patches mentioned and then suffer through the Android build system? Also, what architecture, version, swappiness and specs and stuff? Do you have anything else running (Termux with Tor or Orbot, Conversations, Signal/Molly...) or is it all killed immediatelly?

armv7 needs sligthly less RAM on average (so a 2GB 32-bit phone is more sufferable with Firefox) but running individual 32 bit processes on 64 bit userland is less efficient due to really fat shared libraries that now have to be duplicated, which is why some really crappy modern phone manufacturers (ahem, Samsung) decided to do the unimaginable and build an armv7 kernel with the whole non-free vendor partition shebang for a modern armv8.x/armv9.x CPU.

[-] hexagonwin@lemmy.today 2 points 5 days ago

no i just meant i'm using zram function already available.. haven't improved it or anything. so my comment was kinda offtopic for this thread..

i have two android devices that i use zram on. one is a armv7 msm8974 phone with 2gb ram on android 8.1 (LG G2), the other is an arm64 sdm429 tablet also with 2gb ram on android 11 (Samsung Galaxy Tab A 8.0 2019). i frequently run termux and firefox/kiwibrowser together.

btw this Galaxy Tab A i have is one of those devices where the manufacturer decided to include armv7 kernel on a 64bit device. thankfully the bootloader is 64bit capable, and even the stock rom in one specific region is in 64bit, so i'm able to use 64bit in mine.

the android build system is actually not necessary to modify the android kernel. the kernel zImage/Image.gz can be built by simply getting the android toolchain (arm-eabi-4.9 for me) and compiling the kernel thru linux standard process (export ARCH=arm; export CROSS_COMPILE; make defconfig; make) and manually replacing the kernel in boot.img using unpackbootimg and mkbootimg.

[-] diaphragmwp@discuss.tchncs.de 2 points 5 days ago* (last edited 5 days ago)

Android 16 pre-redesign on LineageOS; 1.5GiB zram, 1.78GiB real RAM, swappiness 100 (I don't remember how I set that but unironically best swappiness value). Firefox kills everything else. Sometimes itself. Tried disk swap, hangs for 2 minutes and instead of killing Firefox or something else; it has a half chance of either loading fine eventually OR killing something else important enough for it to start again from bootanim.zip or whatever it was called.

This is the third time I hopped onto Jerboa to report on the numbers btw, shorter reply each time.

There was a comment somewhere from me about the build system, in short building manually for a 1 line diff made the kernel useless and I had to fuck with my computer a bit for it to allocate like 5x more RAM than it actually had for the build system to start up for like half an hour; then build the kernel in 4 minutes with a quarter of my RAM.

[-] hexagonwin@lemmy.today 1 points 5 days ago* (last edited 5 days ago)

do you have gapps? are there many addons in firefox?

don't use disk swap. it's almost never a good choice.

crashing to boot animation sounds very weird. i haven't experienced it since CM10 (android 4.1.2). perhaps there's a different issue with that rom?

i think you may have to try another rom, or a lower android version. in my experience android 12 and higher is much heavier/sluggish than 11. i'd recommend downgrading.

the android build system is really shitty. it's too optimized for OEM's high spec build servers, us poor plebs can't run it well.. it even needs insane storage space for some reason. for small modifications manual edits work much better

(and btw what device is this?)

[-] diaphragmwp@discuss.tchncs.de 1 points 5 days ago

Redmi 3s. I have microg, although Firefox is actually Fennec F-Droid and doesn't use it. I have UBlock Origin, decentraleyes, indie wiki buddy (only got to use once), libredirect and NoScript. NoScript is annoying for when I do want scripting, although it's a lifesaver for sites (like Discourse instances) that have scriptless variants. I also recall turning down the amount of threads or something in about:config? Not sure if that helped. Also RFP but it's half placebo at this point, my opsec is permanently beyond fucked and my threat model is nonexistent.

android sux inside

Yup.

lower android version

Security patches. I don't want the fucking Bluetooth backdoor. Kinda fine with local privilege at this point, though. Oh, and I ain't setting all that up again.

[-] hexagonwin@lemmy.today 2 points 5 days ago

try less plugins in firefox. i only use ublock origin and numatrix (this can replace noscript and works better). don't enable too many filter lists in ublock, there's pretty severe impact.

or theres the choice of using chromium based instead. somehow they work much smoothly than ff. i still use kiwibrowser but it's discontinued so can't recommend it.. there's no ublock but cromite is decent

not sure wdym bluetooth backdoor tho. i personally don't use BT at all so..

[-] diaphragmwp@discuss.tchncs.de 1 points 5 days ago* (last edited 5 days ago)

There once was once a tiny bug in the Bluetooth stack, reportedly enough for remote code execution.

Re: numatrix: I will check that out, thx. Are you supposed to mix it with an ad blocker, though?

[-] hexagonwin@lemmy.today 1 points 4 days ago

ublock is (mostly) best used as a blacklist filter while numatrix is best as a whitelist filter. you can toggle js, xhr, frame, etc for individual domains and sites with numatrix. similar function isn't impossible to achieve in ublock (which is why gorhill stopped developing umatrix, the origin of numatrix) but it's far more intuitive with numatrix. i suggest you just try as it's fairly easy to understand.

[-] ben_dover@lemmy.world 2 points 5 days ago

unexpected Hungary in the top left corner

this post was submitted on 07 Oct 2026
114 points (100.0% liked)

Linux

15185 readers
243 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 3 years ago
MODERATORS