So we have a block cache like most OSs… but what about a global compressed page cache and or block cache? Where Memory that is not in use is not paged back to disk but is compressed in memory. And paged to disk as a last resort (this would also speed up writes to the page file since all writes and reads would be compressed).
It seems like it would make sense for desktop usage as it would reduce the IO load on disks under heavy load as well as potentially reduce wear from writes on SSDs…
perhaps certain uses of memory could be tagged as compressible as well… for instance read only data.
Packages might not benefit much since they already are compressed but there could be some benefits… in that area perhaps. Certainly desktop OSs stand to benefit from judicious reduction of IOP load on hard drives during cache thrashing and this would also potentially prevent some thrashing to begin with.
There is an implementation of compressed page cache for NetBSD here https://github.com/vnaybhat/ccache
And of course Linux has several advanced subsystems for compressed cache.