Adding Compcache-0.2 module to linux-ubuntu-modules

John McCabe-Dansted gmatht at gmail.com
Mon Mar 10 22:05:42 UTC 2008


Matthew Garrett <mjg59 at srcf.ucam.org> wrote:
> If you can create a diff to linux-ubuntu-modules and put it in
>launchpad, and then contact kernel-team at lists.ubuntu.com, that ought to
> do. I wouldn't necessarily expect this to happen until after hardy's
>released, though.

OK, I've uploaded the debdiff at:
  https://bugs.launchpad.net/ubuntu/+source/linux-ubuntu-modules-2.6.24/+bug/200765

The debdiff adds the compcache module. This module creates a swap
device that stores swapped out pages in memory compressed using lzo.
This greatly reduces the amount of memory required by the LiveCD
before the physical swap file is created.

 I have tested ubiquity+gnome installs with 180MB and 120MB of ram on
7.10 [k]ubuntu and xubuntu respectively. By comparison 7.10 Ubuntu
boots but is unusable with 192MB of ram.

 It appears that with compcache the ubiquity-only install in hardy
will still function with only 256 MB of ram.

Overview of testing: I have tested this with
 - [kx]ubuntu-7.10 and ubuntu-hardy alpha 4 and Mar 08 daily build.
 - VirtualBox, Qemu [smp,nosmp], native DualCore, native P4
 - 120MB through 1GB of ram.
 - token testing with ia64 (but have not enabled ia64 in this patch)
 - have tested that Ubuntu does not try to hibernate onto compcache
partition (by default, you could probably edit text files to do this
if you really wanted to shoot yourself in the foot.).

The only negative I found with compcache-0.2 is that the mouse appears
more jerky under heavy load than when physical swap is used. I have
provided demo patchs against gusty liveCDs at:
  http://www.ucc.asn.au/~mccabedj/ccache/

I have build the arch using
  fakeroot debian/rules binary-arch arch=i386 flavours="generic"
as suggested in debian/rules. It generates the deb fine.
I installed the deb without any problems, and am using it now. No
packages currently depend on compcache, so they cannot be broken.

Two problems that are easily worked around
1) that ubiquity tries to install onto the compcache device (on the
demo cd I rename the device), and
2) compcache uses kernel memory, which is limited to 1GB on i386. To
ensure we don't run out, I limit the compcache size to under 200MB so
less than 100MB of kernel memory is used. (The compression ratio for
the liveCD seems to be robustly 2:1).

See also
  bug 193552 "Support 256MB machines in Ubiquity"
  bug 200418 "Memory usage increase in LiveCD"
https://lists.ubuntu.com/archives/sounder/2008-February/011089.html
https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2008-March/003493.html
https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2008-March/003516.html

These currently allow.

This replaces

 debian/changelog | 9
 debian/config/i386 | 3
 ubuntu/Makefile | 2
 ubuntu/misc/compat.h | 35 ++
 ubuntu/misc/compcache.c | 428 ++++++++++++++++++++++++++++++
 ubuntu/misc/compcache.h | 148 ++++++++++
 ubuntu/misc/config | 2
 ubuntu/misc/tlsf.c | 669 ++++++++++++++++++++++++++++++++++++++++++++++++
 ubuntu/misc/tlsf.h | 93 ++++++
 ubuntu/misc/tlsf_int.h | 179 ++++++++++++
 10 files changed, 1568 insertions(+)

-- 
John C. McCabe-Dansted
PhD Student
University of Western Australia




More information about the kernel-team mailing list