From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1REjj9-0006Rs-0w for garchives@archives.gentoo.org; Fri, 14 Oct 2011 15:31:15 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4EEB721C08C; Fri, 14 Oct 2011 15:31:01 +0000 (UTC) Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by pigeon.gentoo.org (Postfix) with ESMTP id 260DA21C020 for ; Fri, 14 Oct 2011 15:30:10 +0000 (UTC) Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id DACEB20DB5 for ; Fri, 14 Oct 2011 11:30:09 -0400 (EDT) Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute3.internal (MEProxy); Fri, 14 Oct 2011 11:30:09 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=binarywings.net; h=message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=mesmtp; bh=0FlbcX0J0hd3HUeLL55FqyNY dKk=; b=CXH5n+5PKbWe53/jBgtuA0s1XSzu3AMXsM1nYwi0662cIRqSRPIwtt4i Co6b0tVcVIg1Iql+JaP6lpOkNduX0F41myC5RJpWFEn6g/k9V3B9SJplm3GIEzSJ 5qZTKQMA+7s7TzjO8JSyxoxsmgrOVihLcPQkvmJ1pCf+lktGUQY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type; s=smtpout; bh=0Flb cX0J0hd3HUeLL55FqyNYdKk=; b=AzRCjiJ8b+dpOHmoohZHvqqdKdT+c67qvjHW ieBNR+Mgu0fWEN/0kj2PGqLNVkvaF4MsiGUWIwYsRp4IGQzJkwt9e5nnHbB2JDaa abg9Kp5HaVshmrrramLPmiTrBm7/ZG3MQrGGm3692IXaDB1c+3TwjeJlAvliisof 6RKLTPo= X-Sasl-enc: FHayr+2ytTXv/f75yFTxP6pUr6gc9aejJY9GTcY/0RWB 1318606208 Received: from [192.168.5.18] (serv.binarywings.net [83.169.5.6]) by mail.messagingengine.com (Postfix) with ESMTPSA id 0DB21404B1D for ; Fri, 14 Oct 2011 11:30:07 -0400 (EDT) Message-ID: <4E985578.9070503@binarywings.net> Date: Fri, 14 Oct 2011 17:30:00 +0200 From: Florian Philipp User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110925 Lightning/1.0b3pre Thunderbird/3.1.12 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] zram / compcache, anyone? References: <4E96E779.4070006@binarywings.net> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigD87FA276BDF8A3160876333B" X-Archives-Salt: X-Archives-Hash: 3810c4d01217902ccb95b290c40da781 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD87FA276BDF8A3160876333B Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Am 14.10.2011 03:33, schrieb Adam Carter: > On Fri, Oct 14, 2011 at 12:29 PM, Adam Carter w= rote: >>> In the kernel? What .config knob should I twiddle? >> >> Device Drivers -> Staging Drivers -> Compressed RAM block device >=20 > But Dynamic Compression of swap pages underneath looks interesting too > (check the help). > Compressed RAM block device =3D CONFIG_ZRAM > Dynamic Compression of swap pages =3D CONFIG_ZCACHE >=20 Okay, so just to verify I understand this correctly (I doubt it): Cleancache (not to be confused with compcache) is an intermediate layer using a transcendent memory framework [6] for pages that can disappear from the cache at any time. When the kernel has a clean page backed by persistent memory (i.e. a file that has not been changed), instead of removing the page from memory when the space is needed, it can push it into cleancache. When the kernel later loads the page again, it checks the cache to see if it is still there.[1,4] Cleancache requires changes on the filesystem implementations. The patches I've seen did not include any changes to Ext4 or others. Somewhere it was mentioned that a generic hook was included so most filesystems would immediately use it. However, the patches listed on kernelnewbies.org did not include anything that looked like it so I guess it was not included in 3.0. Therefore cleancache looks pretty useless now but might be really neat in the future. Frontswap, on the other hand, can be used for persistent pages (i.e. "normal" anonymous memory for program data).[4] When the kernel would normally swap out the page, it now presents it to frontswap and either frontswap accepts the page (i.e. store it compressed in memory) or refuses it (after which the kernel will really swap it out).[5] Frontswap does not seem to be part of linux-3.0. The article at [4] says it is somewhat controversial. The difference between frontswap and cleancache is that cleancache accepts everything but might not keep it while frontswap does not accept everything but guarantees to keep it. The slightly older zram implementation, on the other hand, uses the same interface as a block device (which can be formatted as a swap device) and therefore cannot decline an offered page like frontswap can. Zram was easier to implement and to get accepted by the kernel community but it is less efficient because it might save pages which are uncompressable= =2E Zcache is a backend used by frontswap and cleancache. It basically reuses zram to offer a storage service for the transcendent memory framework.[2,3] Another backend is implemented in Xen, using hypervisor memory.[1] Any remarks on that summary? Regards, Florian Philipp [1] http://git.kernel.org/?p=3Dlinux/kernel/git/torvalds/linux-2.6.git;a=3Dco= mmitdiff;h=3D4fe4746ab694690af9f2ccb80184f5c575917c7f [2] http://git.kernel.org/?p=3Dlinux/kernel/git/torvalds/linux-2.6.git;a=3Dco= mmitdiff;h=3D9cc06bf88d554dd527ded26eab28eec6a0d0e3df [3] http://lwn.net/Articles/397574/ [4] http://lwn.net/Articles/386090/ [5] http://lwn.net/Articles/386103/ [6] https://lwn.net/Articles/340080/ --------------enigD87FA276BDF8A3160876333B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6YVX0ACgkQqs4uOUlOuU8Q0wCfWW1WEqEKsITFU5wxAsCrynQ7 W4IAni2NKesg2f14x04OCeLDo65ugm8F =hMGA -----END PGP SIGNATURE----- --------------enigD87FA276BDF8A3160876333B--