Thread: [lc-devel] Announce: ccache release 0.1
Status: Beta
Brought to you by:
nitin_sf
From: Nitin G. <nit...@gm...> - 2008-02-18 21:40:04
|
Hi All, I am excited to announce first release of ccache - Compressed RAM based swap device for Linux (2.6.x kernel). - Project home: http://code.google.com/p/ccache/ - ccache-0.1: http://ccache.googlecode.com/files/ccache-0.1.tar.bz2 This is RAM based block device which acts as swap disk. Pages swapped to this device are compressed and stored in memory itself. This is especially useful for swapless embedded devices. Also, flash storage typically used in embedded devices suffer from wear-leveling issues - so, its very useful if we can avoid using them as swap device. And yes, its useful for desktops too :) It does not require any kernel patching. All components are separate kernel modules: - Memory allocator (tlsf.ko) - Compressor (lzo1x_compress.ko) - Decompressor (lzo1x_decompress.ko) - Main ccache module (ccache.ko) (LZO de/compressor is already in mainline but I have included it here since distros don't ship it by default). README (or project home) explains compilation and usage in detail. Some performance numbers for allocator and de/compressor can be found on project home. Currently it is tested on Linux kernel 2.6.23.x and 2.6.25-rc2 (x86 only). Please mail me/mailing-list any issues/suggestions you have. Code reviews will be really helpful! :) Thanks, - Nitin |
From: Nitin G. <nit...@gm...> - 2008-02-19 12:06:53
|
On Feb 19, 2008 4:03 PM, John McCabe-Dansted <gm...@gm...> wrote: > On Feb 19, 2008 6:39 AM, Nitin Gupta <nit...@gm...> wrote: > > Some performance numbers for allocator and de/compressor can be found > > on project home. Currently it is tested on Linux kernel 2.6.23.x and > > 2.6.25-rc2 (x86 only). Please mail me/mailing-list any > > issues/suggestions you have. > > It caused Gutsy (2.6.22-14-generic) to crash when I did a swap off of > my hdd swap. I have a GB of ram, so I would have been fine without > ccache. These days "desktops with small memory" probably means virtual machines with, say, <512M RAM :-) > > I had swapped on a 400MB ccache swap. > I need /var/log/messages (or whatever file kernel logs to in Gutsy) to debug this. Please send it to me offline if its too big. > BTW, why is the default 10% of mem? I have no great justification for "10%". > This refers to the size of the > block device right? So even 100% would probably only use 50% of > physical memory for swap, assuming a 2:1 compression ratio. > Yes, this is correct. Thanks, - Nitin |
From: Nitin G. <nit...@gm...> - 2008-02-19 14:05:10
|
On Feb 19, 2008 6:37 PM, John McCabe-Dansted <gm...@gm...> wrote: > On Feb 19, 2008 9:06 PM, Nitin Gupta <nit...@gm...> wrote: > > On Feb 19, 2008 4:03 PM, John McCabe-Dansted <gm...@gm...> wrote: > > > On Feb 19, 2008 6:39 AM, Nitin Gupta <nit...@gm...> wrote: > > > > Some performance numbers for allocator and de/compressor can be found > > > > on project home. Currently it is tested on Linux kernel 2.6.23.x and > > > > 2.6.25-rc2 (x86 only). Please mail me/mailing-list any > > > > issues/suggestions you have. > > > > > > It caused Gutsy (2.6.22-14-generic) to crash when I did a swap off of > > > my hdd swap. I have a GB of ram, so I would have been fine without > > > ccache. > > > > These days "desktops with small memory" probably means virtual > > machines with, say, <512M RAM :-) > > The Hardy liveCD is really snappy with a 192MB VM and and a 128MB > ccache swap. :) > Good to know :) > > > I had swapped on a 400MB ccache swap. > > > > > > > I need /var/log/messages (or whatever file kernel logs to in Gutsy) to > > debug this. > > Please send it to me offline if its too big. > > This seems to be the bit you want: > Unfortunately none of these messages suggest why crash happened. If you can send entire log, that will probably be more useful. > ubuntu-xp syslogd 1.4.1#21ubuntu3: restart. > Feb 19 08:07:31 ubuntu-xp -- MARK -- > ... > Feb 19 18:47:31 ubuntu-xp -- MARK -- > Feb 19 18:59:51 ubuntu-xp kernel: [377208.185464] ccache: Unknown > symbol lzo1x_decompress_safe <snip> All these 'Unknown symbol' messages are because you tried loading ccache.ko module before tlsf.ko and lzo*.ko modules. > > > > BTW, why is the default 10% of mem? > > > > I have no great justification for "10%". > > Perhaps 100% (or maybe 50%) would be a more sensible default? For me > 66% makes a huge difference to the Hardy liveCD performance. 10% makes > a difference but 50%+ goes from "ls /" taking 10s to snappy > performance even on large applications like Firefox. > I think this depends a lot on kind of workload and system. For e.g: - On desktops, retaining too many anonymous pages at cost of continuously losing page-cache (filesystem-backed) pages can hurt performance for workload that repeatedly access same file(s). - On embedded systems, too much de/compression will drain all battery. and so on... Also, I don't know which of these use cases is more "common". - Nitin |
From: Nitin G. <nit...@gm...> - 2008-02-19 16:46:57
|
On Feb 19, 2008 9:46 PM, John McCabe-Dansted <gm...@gm...> wrote: > On Feb 19, 2008 6:39 AM, Nitin Gupta <nit...@gm...> wrote: > > Hi All, > > > > I am excited to announce first release of ccache - Compressed RAM > > based swap device for Linux (2.6.x kernel). > > - Project home: http://code.google.com/p/ccache/ > > - ccache-0.1: http://ccache.googlecode.com/files/ccache-0.1.tar.bz2 > > I find it counter intuitive that ccache-0.1 is newer than ccache-2.4: > http://ccache.samba.org/ > > Perhaps you should rename this, perhaps to ccacheM (module). > My bad. I knew there is going to be confusion with http://ccache.samba.org/ which has _nothing_ to do with this project. I am now going to rename this project to "compcache" to avoid any confusion. New project home will be: http://code.google.com/p/compcache/ It will take few days for this transition to complete. > FYI, ccache still seems solid under Hardy. > A 128MB ccache swap allowed me to easily install from the liveCD on a > VM with only 192MB of ram, rather than the 384MB officially required > for Gutsy. > However I found a funny bug in ubiquity: > https://bugs.launchpad.net/bugs/193267 > http://www.ucc.asn.au/~mccabedj/ccache/Screenshot-Hardy-fdccache.png > Installing Hardy to /dev/ccache sound like a great idea ;) Yeah. Interesting :) - /dev/ccache really should not be visible there since its _not_ possible to install on this device! This is not a _generic_ block device and can be used only as a swap disk. However, I am not sure how to make it invisible to installer (maybe load module after partitioning step is over?). > > I am using a DualCore, with the iso sitting on the harddisk, so a real > low-mem machine could be a lot slower. however Ubuntu is meant to > require 384MB of memory to install and 256MB of memory to use. It > seems that by adding ccache to the liveCD we could just state a single > figure of 256MB (which is 64MB less than 256MB, so we are giving > ourselves plenty of breathing space for RAM stealing video cards, > unexpected usage spikes etc.) > > > -- > John C. McCabe-Dansted > PhD Student > University of Western Australia > |
From: Nitin G. <nit...@gm...> - 2008-02-20 08:12:50
|
On Feb 19, 2008 3:09 AM, Nitin Gupta <nit...@gm...> wrote: > Hi All, > > I am excited to announce first release of ccache - Compressed RAM > based swap device for Linux (2.6.x kernel). > - Project home: http://code.google.com/p/ccache/ > - ccache-0.1: http://ccache.googlecode.com/files/ccache-0.1.tar.bz2 This project has now moved to: http://code.google.com/p/compcache/ This was done to avoid confusion with http://ccache.samba.org/ which has nothing to do with this project. PS: only user visible change done is that virtual swap device is now called /dev/compcache - Nitin |
From: Nitin G. <nit...@gm...> - 2008-02-20 12:40:34
|
On Feb 20, 2008 1:59 PM, John McCabe-Dansted <gm...@gm...> wrote: > On Wed, Feb 20, 2008 at 5:12 PM, Nitin Gupta <nit...@gm...> wrote: > > This project has now moved to: http://code.google.com/p/compcache/ > > > > This was done to avoid confusion with http://ccache.samba.org/ which > > > > has nothing to do with this project. > > > > PS: only user visible change done is that virtual swap device is now > > called /dev/compcache > > You haven't updated the README file, fortunately > sed s/ccache/compcache/g < README > README.new > seems to do exactly what you want. > Now compcache download has updated README. > Perhaps for the convenience of your users you could also include > swapon_compcache.sh: > > #!/bin/sh > #Ubuntu Hardy does include lzo_compress and lzo_decompress I wonder why ubuntu renamed lzo1x_compress module to lzo_compress and likewise for decompressor. Anyway, I will add these scripts to download. > (modprobe lzo_compress || insmod > ./sub-projects/compression/lzo-kmod/lzo1x_compress.ko) && > (modprobe lzo_decompress || insmod > ./sub-projects/compression/lzo-kmod/lzo1x_decompress.ko) && > insmod ./sub-projects/allocators/tlsf-kmod/tlsf.ko && > insmod ./compcache.ko && > #insmod ./compcache.ko compcache_size_kbytes=128000 && > sleep 1 && > swapon /dev/compcache > lsmod | grep lzo > lsmod | grep tlsf > lsmod | grep cache > > And swapoff_compcache.sh: > > #!/bin/sh > swapoff /dev/ccache > swapoff /dev/compcache > rmmod ccache > rmmod compcache > rmmod tlsf > rmmod lzo1x_compress > rmmod lzo_compress > rmmod lzo1x_decompress > rmmod lzo_decompress > > > -- > John C. McCabe-Dansted > PhD Student > University of Western Australia > |
From: ace <ace...@at...> - 2008-02-26 17:53:49
|
Hi. Great to hear that! I tested it on kernel 2.6.24 and it seems to work. But can you recommend any benchmark to test if using compcache actually is any faster than normal swap? I am curious because I have an old 1.4Ghz CPU and a new harddisk (hdparm shows 166MB/s from cache, 66MB/s from disk). The disk may actually be faster than all that compressing... But probably random writes/reads from swap may kill that theoretical linear read speed and the compressed memory wins. I'll try to come up with something. Thanks Peter Nitin Gupta wrote: > Hi All, > > I am excited to announce first release of ccache - Compressed RAM > based swap device for Linux (2.6.x kernel). > - Project home: http://code.google.com/p/ccache/ > - ccache-0.1: http://ccache.googlecode.com/files/ccache-0.1.tar.bz2 > > This is RAM based block device which acts as swap disk. Pages swapped > to this device are compressed and stored in memory itself. This is > especially useful for swapless embedded devices. Also, flash storage > typically used in embedded devices suffer from wear-leveling issues - > so, its very useful if we can avoid using them as swap device. > And yes, its useful for desktops too :) > > It does not require any kernel patching. All components are separate > kernel modules: > - Memory allocator (tlsf.ko) > - Compressor (lzo1x_compress.ko) > - Decompressor (lzo1x_decompress.ko) > - Main ccache module (ccache.ko) > (LZO de/compressor is already in mainline but I have included it here > since distros don't ship it by default). > README (or project home) explains compilation and usage in detail. > > Some performance numbers for allocator and de/compressor can be found > on project home. Currently it is tested on Linux kernel 2.6.23.x and > 2.6.25-rc2 (x86 only). Please mail me/mailing-list any > issues/suggestions you have. > > Code reviews will be really helpful! :) > > Thanks, > - Nitin |