Gentoo Archives: gentoo-user

From: Florian Philipp <lists@×××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] zram / compcache, anyone?
Date: Thu, 13 Oct 2011 06:59:47
Message-Id: 4E968C11.9070206@binarywings.net
In Reply to: [gentoo-user] zram / compcache, anyone? by Pandu Poluan
1 Am 13.10.2011 03:52, schrieb Pandu Poluan:
2 > Just stumbled upon this blog:
3 >
4 > http://www.webupd8.org/2011/10/increased-performance-in-linux-with.html
5 >
6 > anyone got any experience with zram/compcache on Gentoo?
7 >
8 > Rgds,
9 >
10
11 Yes, I use it on my laptop (4GB RAM, typically 1-2GB swap used). It
12 works pretty well but I can't give you any hard figures.
13
14 I wrote my own init script for this. I can share it if you want.
15 Otherwise the sunrise, betagarden and mv overlays offer ebuilds for it.
16 I think the mv version is closest to mine.
17
18 What has been pretty confusing is that there are two versions: The
19 original one from Google(?) and the one in the mainline kernel. They
20 have different APIs (hint: if you have a userland tool instead of
21 manipulating /sys, it is the original version) and only the original
22 version can use a swap device as an additional backend for
23 uncompressable pages. With the mainline version (which I use), you can
24 only use zram as an additional swap device and give it a higher priority
25 than your normal swap.
26
27 /etc/fstab:
28 /dev/zram0 none swap sw,pri=1,discard 0 0
29 /dev/sda7 none swap sw,pri=0 0 0
30
31 Only drawback so far: When zram is full, putting the laptop into standby
32 takes longer, maybe 15s compared to 3s without. Sometimes this can lead
33 to timeouts and the kernel aborts the suspend operation with an error on
34 dmesg. Reattempting it then succeeds.
35
36 Regards,
37 Florian Philipp

Attachments

File name MIME type
signature.asc application/pgp-signature