View previous topic :: View next topic |
Author |
Message |
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Mon Jul 25, 2011 5:02 pm Post subject: [SOLVED] how to enable CLEANCACHE and ZCACHE ? |
|
|
is there any specific way to enable cleancache and zcache features in gentoo-sources-3.0 ?
I've configured CONFIG_CLEANCACHE and CONFIG_ZCACHE in kernel config,
put zcache kernel boot option in grub.conf,
but there's nothing useful in dmesg:
Code: | tnt cleancache # grep CLEANCACHE /usr/src/linux/.config
CONFIG_CLEANCACHE=y
tnt cleancache # cat /var/log/dmesg |grep cleancache
tnt cleancache # grep ZCACHE /usr/src/linux/.config
CONFIG_ZCACHE=y
tnt cleancache # cat /var/log/dmesg |grep zcache
Command line: root=/dev/sda1 zcache vga=0x31B
Kernel command line: root=/dev/sda1 zcache vga=0x31B
tnt cleancache # |
_________________ gentoo user
Last edited by tnt on Sat Jul 30, 2011 8:26 pm; edited 1 time in total |
|
Back to top |
|
|
pmootrey n00b
Joined: 23 Jul 2011 Posts: 17
|
Posted: Mon Jul 25, 2011 11:23 pm Post subject: |
|
|
I was also wondering this. I also appended zcache to the kernel line, but I don't see anything in dmesg. |
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Wed Jul 27, 2011 12:12 pm Post subject: |
|
|
is there anyone successfully using cleancache and zcache ? _________________ gentoo user |
|
Back to top |
|
|
skunk l33t
Joined: 28 May 2003 Posts: 646 Location: granada, spain
|
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Wed Jul 27, 2011 3:58 pm Post subject: |
|
|
skunk wrote: | http://lwn.net/Articles/397894/ |
thx for the link, but...
I've tried compcache/ramzswap/zram before. back then it was ok, but it did not release used memory once drive/swap shrinked.
anyway, right now I'm looking for:
Code: | CONFIG_ZCACHE: Zcache doubles RAM efficiency while providing a significant
performance boosts on many workloads. Zcache uses lzo1x
compression and an in-kernel implementation of transcendent
memory to store clean page cache pages and swap in RAM,
providing a noticeable reduction in disk I/O. |
_________________ gentoo user |
|
Back to top |
|
|
tclover Guru
Joined: 10 Apr 2011 Posts: 516
|
Posted: Thu Jul 28, 2011 1:40 pm Post subject: |
|
|
I'd advice to build zram as a module and not build in in the kernel as it's still... a staging driver with no warranty for whatever reason.
And then try to load the module with argument[s] like `num_devices=4' if ever you wanted four devices. Last time I tried to make use of it quickly discouraged me altogether. I'd see later what I can do with it--I'm primary interested to use for /var/{log,run} and my firefox home profile folder, well var/run is not that important because I can put it in a tmpfs based disk.
Of course you can go read the very outdated documentation on their code.google page.
Note that if your remove the module some `/dev/block/253:*' will remain in the directory--253 is the major number of /dev/zram* devices, you'll have to rm them manually. Then you can try to play with a few features in /sys/block/zram* to setup the size and such. I tried to make a reiserfs or reiser4 based system on a device only to fail. Again, it was a quick test, but the first attempt failed badly!
EDIT: I'm just relizing that I can do all that--set a disksize,mkfs.reiser*--being root! sudo doesn't seem work. Let's see what I can do with it. |
|
Back to top |
|
|
pmootrey n00b
Joined: 23 Jul 2011 Posts: 17
|
|
Back to top |
|
|
pmootrey n00b
Joined: 23 Jul 2011 Posts: 17
|
Posted: Fri Jul 29, 2011 11:17 pm Post subject: |
|
|
Patch fixes the issue.
dmesg now reports:
zcache: cleancache enabled using kernel transcendent memory and compression buddies
zcache: created ephemeral tmem pool, id=0
zcache: created ephemeral tmem pool, id=1
[Update]
Noticeable performance increase. |
|
Back to top |
|
|
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Sat Jul 30, 2011 4:01 pm Post subject: |
|
|
after applying patch:
Code: | zcache: cleancache enabled using kernel transcendent memory and compression buddies
zcache: created ephemeral tmem pool, id=0 |
so, that's it? now it works?
no need to put some extra settings somewhere? _________________ gentoo user |
|
Back to top |
|
|
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Sat Jul 30, 2011 8:26 pm Post subject: |
|
|
thx a lot!
I'll mark thread as solved. _________________ gentoo user |
|
Back to top |
|
|
psomas Retired Dev
Joined: 23 Sep 2006 Posts: 212 Location: Greece
|
Posted: Sat Jul 30, 2011 8:50 pm Post subject: |
|
|
This is a known bug in linux-3.0. Hopefully, it'll be fixed in 3.1, and probably 3.0.1. _________________ myblog
FOSS NTUA Community |
|
Back to top |
|
|
tclover Guru
Joined: 10 Apr 2011 Posts: 516
|
Posted: Sun Jul 31, 2011 4:12 am Post subject: |
|
|
And to finish puting my 2 cent post, with kernel .38.8{zen,pf}, I have nothing in dmesg as well, however `/sys/kernel/mm/zcache/' are populated with 3 pool folders.
Now, If somebody managed to get something out of zram, do not hesitate to post something.
EDIT: This is not a joke... with my setup with {,s}bin:lib{32,64}:usr:var/portage:var/lib/layman squashed (squashfs+aufs) and running e17, my system is just using a bit over 512MB of RAM with firefox using almost 200MB without taking into account my $HOME/.mozilla/firefox/h*.default which is mounted on 128MB tmpfs! Now, I'm going to see if I can effectively put my profile on a zram based device. |
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Tue Aug 02, 2011 2:03 am Post subject: |
|
|
on one of my boxes, I've got:
Code: | Aug 2 02:22:26 titan kernel: Command line: root=/dev/md1 rootflags=data=writeback zcache acpi_enforce_resources=lax
Aug 2 02:22:26 titan kernel: Kernel command line: root=/dev/md1 rootflags=data=writeback zcache acpi_enforce_resources=lax
Aug 2 02:22:26 titan kernel: zcache: cleancache enabled using kernel transcendent memory and compression buddies
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=0
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=1
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=2
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=3
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=4
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=5
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=6
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=7
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=8
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=9
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=10
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=11
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=12
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=13
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=14
Aug 2 02:22:26 titan kernel: zcache: created ephemeral tmem pool, id=15
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded
Aug 2 02:22:26 titan kernel: zcache: pool creation failed: max exceeded |
I needed more then 16 zcache pools (server with 33 ext4 filesystems), so I've made change in one file to enable more then 16 pools.
here it is, just in case someone's interested:
Code: | --- a/drivers/staging/zcache/zcache_drv.c 2011-08-02 01:30:08.991848159 +0200
+++ b/drivers/staging/zcache/zcache_drv.c 2011-08-02 02:34:25.898160421 +0200
@@ -677,7 +677,7 @@
static unsigned long zcache_failed_eph_puts;
static unsigned long zcache_failed_pers_puts;
-#define MAX_POOLS_PER_CLIENT 16
+#define MAX_POOLS_PER_CLIENT 36
static struct {
struct tmem_pool *tmem_pools[MAX_POOLS_PER_CLIENT]; |
_________________ gentoo user |
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Sat Aug 06, 2011 11:57 am Post subject: |
|
|
ok, just an info:
I gave up on cleancache on that specific server.
my C2D 4MB L2 cache 2.33GHz CPU cannot cope with the amount of data it needs to compress during heavy sequential IO.
I get 60-70MB/s from my RAID array and both CPU cores are saturated with system (kernel) time.
without cleancache, RAID gives me more then 300MB/s.
so, using cleancache in scenarios with a lot of non-random data throughput can lead to very ugly performance degradation.
guess cleancache/zcache should implement some kind of compression throttling vavle:
if there's available CPU time, then compress;
if there's no avalable CPU time, just store (or throw away); _________________ gentoo user |
|
Back to top |
|
|
tclover Guru
Joined: 10 Apr 2011 Posts: 516
|
Posted: Sun Aug 07, 2011 3:38 pm Post subject: |
|
|
Hi tnt, you may, and I'd rather say "should" if I can say, post or email your findings to Dan and to the other devs who are working on it. You can get the emails adresses easily on lkml related patch post.
I had a little time to play with zram but I did not manage to use it for my firefox $HOME/.mozilla/firefox/h*.default profile. I can eventually--as root only and it seems sudo command is not safe with zram--set the size of the device; make a fs--I tried reiser4 and reiserfs, I gave up on reiser4 because it was more troublesome to set up;--mount the fs on $HOME/?mozilla/firefox/h*.default profile; remount again with the right `-o gid=$(id -g),uid=$(id -u)' because I had some trouble in the first mount with combining them with `nodev' mount options. And everything should be set to use it as my firefox profile underlying device backend. However, when extracting a tarball archive containing my firefox profile data to it, tar unexpectedly hang on the task for some reason. So I tried to extract the tarball as root with passing the `p' option to see if I could get something and again... tar hang on the task. I could not finish my test with reiserfs because of it. |
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Sun Aug 07, 2011 4:32 pm Post subject: |
|
|
I've already made a gentoo bug report. I'll report that on lkml, too.
https://bugs.gentoo.org/show_bug.cgi?id=377975
I guess that using any "complicated" fs on top of zram is useless: even linear search through zram should be fast enough and we should not need any B-tree optimisations.
have you tried ext2 or maybe ext4 without a jurnal? _________________ gentoo user |
|
Back to top |
|
|
Ormaaj Guru
Joined: 28 Jan 2008 Posts: 319
|
Posted: Mon Aug 15, 2011 5:32 am Post subject: |
|
|
Watching this since patching and booting to ext4 - Little formatting:
Code: | while :; do for i in /sys/kernel/mm/cleancache/*; do printf '%-15s %d\n' "${i##*/}:" "$(< $i)"; done; sleep .5; clear; done |
Not looking good.
Code: | failed_gets: 244717
flushes: 15416
puts: 0
succ_gets: 0
|
|
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Tue Aug 16, 2011 7:49 pm Post subject: |
|
|
you have to wait until your memory is filled up with caches/buffers.
try copying some big amount of files (size of files should exceed your RAM). _________________ gentoo user |
|
Back to top |
|
|
Ormaaj Guru
Joined: 28 Jan 2008 Posts: 319
|
Posted: Wed Aug 17, 2011 12:26 pm Post subject: |
|
|
Sure enough. My page cache usually fills faster. |
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Thu Jan 05, 2012 2:04 pm Post subject: |
|
|
From the referenced lkml thread and other places, I'm getting the distinct impression that I should just turn off cleancache and zcache until frontswap makes it in. Unfortunately frontswap doesn't appear to have made it into the newly released 3.2, or at least I see nothing for it in the kernel configuration options.
Comment? _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
papu l33t
Joined: 25 Jan 2008 Posts: 709 Location: Sota algun pi o alzina...
|
Posted: Mon May 13, 2013 1:36 pm Post subject: |
|
|
hi, i discovered zcache yesterday , i am trying to understand it: seems it's like a compresed buffer on system ram to avoid swap and i/o hd reads.
i have a dude if with a large ram(16GB) system, like my pc, it's necessary to activate zcache or it does not get any benefit.
Code: | dmesg | grep -i zcache
[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.9.2-gentoo root=UUID=d9d69626-589a-49a8-b37a-fdabdbfea62f ro radeon.audio=1 zcache
[ 0.451075] zcache: using lzo compressor
[ 0.451181] zcache: cleancache enabled using kernel transcendent memory and compression buddies
[ 0.451215] zcache: cleancache: ignorenonactive = 1
[ 0.451242] zcache: frontswap enabled using kernel transcendent memory and compression buddies
[ 0.451275] zcache: frontswap: excl gets = 1 active only = 1
[ 1.892208] zcache: created ephemeral local tmem pool, id=0
[ 1.943475] zcache: destroyed local pool id=0
[ 1.995064] zcache: created ephemeral local tmem pool, id=0
[ 19.041864] zcache: created ephemeral local tmem pool, id=1
[ 19.233923] zcache: created persistent local tmem pool, id=2 |
thanks so much _________________ "~amd64" --cpu 7700 non-x --DDR5 2x16GB 6000MHz --gpu RX 470 |
|
Back to top |
|
|
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
|
Back to top |
|
|
|