[G1 Q&A, Help & Troubleshooting] overpower:
There are two ways to use an existing linux-swap as a backup to Compcache.

Let linux manage compcache and the linux-swap partition/file directly

Let compcache manage the linux-swap partition. *As of this writing, cyanogen has only included the .5 series of compcache which will not support a linux-swap file.

You need to first create the compcache swap device. I assume you are running a cyanogen kernel and you have compiled modules. Also I assume you know what your swap partition or swap file is called. e.g. A swap file looks like /system/sd/swapfile.swp, a swap partition looks like /dev/block/mmcblk0p3.

1. Linux managed:

Pros: Supports linux-swap file. Relies on established linux swapping priorities.

Cons: compcache wastes space as incompressible data remains in the compcache swap. Linux uses compcache until its full, then places everything in the backing swap.

First we enable the compcache swap device.

insmod /system/modules/lib/modules/2.6.29-cm/compcache/xvmalloc.ko; #load the compcache memory allocator
insmod /system/modules/lib/modules/2.6.29-cm/compcache/ramzswap.ko disksize_kb=24576; #create a compressed swap device with disk size 24576 kB
mknod /dev/ramzswap0 b 253 0; #initialize ramzswap0
swapon /dev/ramzswap0; #turn on compcache swap first so it has higher priority. (defaults as -1)

Next we either enable the swap file or the swap partition.

If you have a swap file then the next line is.

swapon /system/sd/swapfile.swp; #turns on second swap as priority -2, lower priority than above.

or

swapon /dev/block/mmcblk0p3; #turns on second swap as priority -2, lower priority than above.

To check to see whether it works, you will type:

cat /proc/swaps/

and see either

# cat /proc/swaps
Filename	Type	Size	Used	Priority
/dev/ramzswap0 partition	24464	6584	-1
/system/sd/swapfile.swp file	31596	0	-2

or

# cat /proc/swaps
Filename	Type	Size	Used	Priority
/dev/ramzswap0 partition	24464	6584	-1
/dev/block/mmcblk0p3 partition	31596	0	-2

2. Compcache .5.3 managed:

Pros: compcache can attempt to maximize compressed data in compcache and intelligently allocate to backing swap.

Cons: Relies on newer algorithms. Does not support swap files yet.

When cyanogen updates to compcache .6.x, you can use the swap file, until then, its just the swap partition.

insmod /system/modules/lib/modules/2.6.29-cm/compcache/xvmalloc.ko; #load the compcache memory allocator
insmod /system/modules/lib/modules/2.6.29-cm/compcache/ramzswap.ko [b]backing_swap=/dev/block/mmcblk0p3 memlimit_kb=24576; [/b] #create a compressed swap device with disk size 24576 kB #NOTE! Memlimit currently ignored in current build. Default to 14 megs (15% memory)
mknod /dev/ramzswap0 b 253 0; #initialize ramzswap0
swapon /dev/ramzswap0; #turn on compcache swap, this includes the backing swap which should be invisible to linux.

NOTE: There is no need to enable any other swaps afterward unless you want a linux managed backing swap

If you type

cat /proc/swaps/

you will see:

# cat /proc/swaps
Filename	Type	Size	Used	Priority
/dev/ramzswap0 partition	24464	6584	-1

Use

cat /proc/ramzswap

and if you don't have a backing swap you will see.

# cat /proc/ramzswap
DiskSize:	24468 kB
NumReads:	1260
NumWrites:	2042
FailedReads:	0
FailedWrites:	0
InvalidIO:	0
PagesDiscard:	0
ZeroPages:	113
GoodCompress:	74 %
NoCompress:	3 %
PagesStored:	1929
PagesUsed:	630
OrigDataSize:	7716 kB
ComprDataSize:	2482 kB
MemUsedTotal:	2520 kB

if you do, it should say

# cat /proc/ramzswap
DiskSize:	31250 kB
MemLimit:	14680 kB
NumReads:	5186
NumWrites:	9229
FailedReads:	0
FailedWrites:	0
InvalidIO:	0
PagesDiscard:	0
ZeroPages:	578
GoodCompress:	100 %
NoCompress:	0 %
PagesStored:	5313
PagesUsed:	1425
OrigDataSize:	21252 kB
ComprDataSize:	5532 kB
MemUsedTotal:	5700 kB
[b]BDevNumReads:	1185
BDevNumWrites:	2145
[/b]

3. Miscellaneous Notes:

As I typed this I realized I was pulling information from the .6.x tree and the .5.x tree. It's possible that the syntax for compcache has changed.

Also, if anyone wants to update the wiki with this, I'd appreciate it. I don't feel like formatting for the wiki right now. ;)