Linux – How to set up properly zram and swap

linuxswapvirtual-memoryzram

I'm configuring & compiling new 3.0 kernel. One of the goodies I planned to use for some time (by patching) that was merged into 3.0 is zram.

Is it possible to set both hdd swap and zram swap so the zram is used first and only spilled pages are put into actual swap?

Best Answer

Sidenote: because of per-cpu locking, it is important to have as many zram-swaps as CPUs (modprobe zram_num_devices=n zram) instead of a single big one. RTFM!

Related Question