News for hackers. Stuff that matters.
Re:Swap, swap, swap, and bad places to work by dredmorbius on Friday August 09, 2019 @06:30AM (#20652982)
Swap dates to the 1960s. zram was introduced to the mainline Linux kernel in 2014.[1] zswap presumably later, though Wikipedia states it was added in 2013, possibly indicating improved temporal performance under zswap.[2] Hrm, actually, they appear to be two distinct features.

There's a lot of institutional knowledge, and mythology, around swap. Less so around zram/zswap, and that is going to compete with other competing capabilities and lore.

I've been wranging boxen since the late 1990s, and using Unix since at least the late 1980s. I'd only run across references to zswap / zram a few weeks ago when attempting to compile OpenWRT, and didn't look into it until seeing your comment (one reason for writing copiously footnoted HN comments -- I might accidentally learn something).

zswap might very well be The Answer We've All Been Looking for, but, well, All Of Us Realising that is another stage in the Hierarchy of Failures in Problem Resolution.[3]

________________________________

Notes:

1. https://en.m.wikipedia.org/wiki/Zram

2. https://en.m.wikipedia.org/wiki/Zswap

3. https://old.reddit.com/r/dredmorbius/comments/2fsr0g/hierarc...

Re:Swap, swap, swap, and bad places to work by arendtio on Friday August 09, 2019 @11:53AM (#20655487)
Thanks for the info. For everybody, who wants to use it with Arch Linux, the following link should give a good overview:

https://wiki.archlinux.org/index.php/Improving_performance#Z...

If you want to use the systemd solution you can do it like:

  pacman -S systemd-swap
  vim /etc/systemd/swap.conf   # disable zswap, enable zram
  systemctl start systemd-swap.service
  systemctl enable systemd-swap.service
Re:Swap, swap, swap, and bad places to work by mrob on Friday August 09, 2019 @08:10AM (#20653552)
Using zram swap in a recent Debian is as simple as installing "zram-tools" (and changing the size in /etc/default/zramswap if you're not happy with the default).
Re:Swap, swap, swap, and bad places to work by dredmorbius on Friday August 09, 2019 @09:13AM (#20653948)
... and knowing to do that. And knowing to do that over other methods.

Institutional knowledge, mindshare, and documentation are all Things.

Debian's documentation (Debian Administrator's Handbook, Debian Installation Guide, Debian FAQ) do not appear to mention either zram or zswap at all. DAH/DIG do mention swap configuration, but only in terms of traditional swap patterns.

There is mention on the Debian Wiki: https://wiki.debian.org/ZRam But not under the Swap topic: https://wiki.debian.org/Swap

"As easy as" really doesn't mean much if the information isn't accessible. It's also harder to to advocate if it's not at least mentioned in standard documentation.

If you're aware of any standard Linux documentation mentioning zram/zswap as options, please let me know.

Again: this is not an argument against the technical merits or advisibility of zram or zswap. It's an argument that knowledge of these options is not widely disseminated or assimilated. I'd commented recently on the matter of intergenerational knowledge transfer, both general and specific (https://news.ycombinator.com/item?id=20617656). This would be a case of that.

Re:Swap, swap, swap, and bad places to work by zzzcpan on Friday August 09, 2019 @06:44AM (#20653052)
Zswap is still backed by disk, it's better than a raw swap of course, but disk is still a problem. I fallback to zswap only if I can't use zram on a system.