Re: zswap: How to determine whether it is compressing swap pages?

From: Martin Steigerwald
Date: Wed Jul 17 2013 - 15:38:18 EST


Am Mittwoch, 17. Juli 2013, 09:38:34 schrieb Seth Jennings:
> On Wed, Jul 17, 2013 at 01:41:44PM +0200, Martin Steigerwald wrote:
> > Is there any way to run zcache concurrently with zswap? I.e. use zcache only
> > for read caches for filesystem and zswap for swap?
>
> No, at least not with zcache's frontswap features enabled. frontswap is a very
> simple API that allows only one "backend" to register with it at a time. So
> that means _either_ zswap or zcache.
>
> The only way they can be used in a meaningful way together is to use the
> "nofrontswap" zcache option in the kernel boot parameters to prevent
> zcache overriding zswap's frontswap registration.
>
> But the general answer is no, they shouldn't be used together.
>
>
> >
> > What is better suited for swap? zswap or zcache?
>
> zswap targets the specific case of caching swapped out pages in a compressed
> cache and this is much simpler than zcache. zswap is also in mainline as of
> 3.11-rc1.

Thanks.

Okay, then I will test zswap for now. I have a nice use case for it: Playing
PlaneShift while a full KDE session is open with 8 GB of RAM. The PlaneShift
client easily takes 2 GB RSS and to complicate matters I think there is even
a mem leak either in Intel Mesa driver or in PS client. zswap may not help
much with that I think. This brought down my laptop several times with a
storm to swap which locked the machine - no mouse movements possible -
for minutes while using the SSD like wild (LED constantly lid).

Currently I see zswap did some work:

merkaba:/sys/kernel/debug/zswap> grep . *
duplicate_entry:0
pool_limit_hit:0
pool_pages:14565
reject_alloc_fail:0
reject_compress_poor:1905
reject_kmemcache_fail:0
reject_reclaim_fail:0
stored_pages:29092
written_back_pages:0

About a hour later:

merkaba:/sys/kernel/debug/zswap> grep . *
duplicate_entry:0
pool_limit_hit:0
pool_pages:18924
reject_alloc_fail:0
reject_compress_poor:1907
reject_kmemcache_fail:0
reject_reclaim_fail:0
stored_pages:37820
written_back_pages:0

> zcache, a driver in the staging tree, is much more complex offers some other
> functionality like compressed page/file cache for certain filesystems using
> cleancache and a remote-RAM system called RAMster.

I´d be interested in the cleancache stuff, but I wonder whether it would make
much of a difference with a desktop workload.

Anyway, for a while I focus on testing zswap.

--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/