Looking at the solution AMD bought, looks like Linux has a lot of room to improve regarding moving (compressed) inactive pages to disk: https://www.amd.com/en/products/software/mext.html.
If my understanding is correct, both ZRAM and ZSWAP write uncompressed pages to disk. And both don't pack the pages together meaning even if we'd write compressed pages (let's say they compress 5:1), we'd still write the original size to disk. This is crazy.
FWIW, DAMON (https://docs.kernel.org/mm/damon/design.html#operation-actio...) has supported explicit control over Linux working sets for a while now. For whatever reason, ISTM few people know about it, but it's a nice subsystem with a lot of policy flexibility.
> If my understanding is correct, both ZRAM and ZSWAP write uncompressed pages to disk.
ZRAM added compressed_writeback in 7.0, it needs to be explicitly enabled.