Writing back compressed pages
Writing back compressed pages
Posted Feb 25, 2026 1:58 UTC (Wed) by intelfx (subscriber, #130118)In reply to: Writing back compressed pages by PeeWee
Parent article: Modernizing swapping: virtual swap spaces
Tmpfs certainly is {,z}swappable. Perhaps your system was misconfigured.
> I don't really see the appeal of zram as a general-purpose block device. I believe someone wanted a compressed tmpfs. And then they realized, by running mkswap on it, that one can get "compressed RAM" on the cheap. While that is not unreasonable, using it that way, has some side effects.
Yes. Trying to pass zram as a swap device, IMO, is a pretty blatant abuse of mm that only flies because practical deployments rarely get to exercise the interesting corner cases (in addition to the priority inversion concerns that you mention). For one, the swap subsystem is not designed around fallibility of swap devices. What would happen, for instance, if you configure a zram device with a limit on physical RAM utilization which is subsequently hit before the declared logical capacity is used up (for example, due to the data being incompressible)? Your guess is as good as mine.
