[linux-mm-cc] Zram and SwapCached

Nitin Gupta nitingupta910 at gmail.com
Thu Jul 19 11:15:40 EDT 2012


Hi,


On Thu, Jul 19, 2012 at 6:39 AM, DC-1 <DC-1 at sirc.hu> wrote:

>
> I have a question about zram + swapcached. I know that zram is a
> compressed swap in memory, but linux use it's own internal SwapCached
> area to store recent swap pages _also_ in memory. I have a 512mb laptop
> with a ~128mb zram swap drive.
> So zram_stats says:
>         orig_data_size:     97419264
>         compr_data_size:    40315919
>
> and: grep SwapCache /proc/meminfo
>         SwapCached:        90200 kB
>
> So does it mean i have these swap pages in ram twice? First
> is compressed, and second is uncompressed by linux internal swapcache
> feature?
>


There can be some overlap between zram stored pages and the swapcache. The
amount of overlap cannot be determined by any of the exported stats however
this overlap should not be an issue since these pages are expected to be
swapped again soon and in case they are clean (i.e. not modified) since the
last write to zram disk, we avoid re-compressing them since they are
already in compressed RAM.



> If it is true, it's not very useful to save ~57MB while it's also in
> ram with ~90MB.
>
> Anyway: can i disable linux's swapcache feature at all when i'm
> swapping to zram? Or can I limit the maximum swapcached area?
>
>
swapcache can be disabled only by disabling swap subsystem itself during
kernel compilation. Again, zram + swapcache interaction should not be an
issue and I explained above.

Anyways, please use zram from the mainline kernel where it is being
actively maintained. I do not update the out-of-tree version (as available
in the downloads section) any longer.

Thanks,
Nitin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/linux-mm-cc/attachments/20120719/6579a12e/attachment.html>


More information about the linux-mm-cc mailing list