Hi,<div><br><br><div class="gmail_quote">On Thu, Jul 19, 2012 at 6:39 AM, DC-1 <span dir="ltr"><<a href="mailto:DC-1@sirc.hu" target="_blank">DC-1@sirc.hu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I have a question about zram + swapcached. I know that zram is a<br>
compressed swap in memory, but linux use it's own internal SwapCached<br>
area to store recent swap pages _also_ in memory. I have a 512mb laptop<br>
with a ~128mb zram swap drive.<br>
So zram_stats says:<br>
        orig_data_size:     97419264<br>
        compr_data_size:    40315919<br>
<br>
and: grep SwapCache /proc/meminfo<br>
        SwapCached:        90200 kB<br>
<br>
So does it mean i have these swap pages in ram twice? First<br>
is compressed, and second is uncompressed by linux internal swapcache<br>
feature?<br></blockquote><div><br></div><div><br></div><div>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.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If it is true, it's not very useful to save ~57MB while it's also in<br>
ram with ~90MB.<br>
<br>
Anyway: can i disable linux's swapcache feature at all when i'm<br>
swapping to zram? Or can I limit the maximum swapcached area?<br><br></blockquote><div> </div></div>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.</div>
<div><br></div><div>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.</div><div><br></div>
<div>Thanks,</div><div>Nitin</div><div><br></div>