zcache behavior when swapping to disk
I know in general how zcache works using cleancache and frontswap frontends. However I would like to ask how zcache behaves when actually swapping to the physical hard drive (for instance because memory is full). Is it saving compressed pages to disk or are pages that need to be written to disk uncompressed first?
In general, as hard drives are slow, even without zcache I would imagine that compressing everything with a fast algorithm such as LZO would be faster than just writing uncompressed data. However if zcache is used we have the additional advantage that compression comes "for free" upstream. Pages previously stored into memory are already compressed, but even pages that are not actually stored into memory because they do not shrink by half were pre-processed by zcache, so it would make sense to save all pages to disk compressed.
Thanks.
|