make zram use lz4 compression algorithm
This works:
# initialize the devices
for i in $(seq ${NRDEVICES}); do
DEVNUMBER=$((i - 1))
echo lz4 > /sys/block/zram${DEVNUMBER}/comp_algorithm
echo $mem > /sys/block/zram${DEVNUMBER}/disksize
mkswap /dev/zram${DEVNUMBER}
swapon -p 100 /dev/zram${DEVNUMBER}
done
Note: it seems you need to define the compression algorithm before zram size. Set swapon -p
to priority level 100
to use zram actively as it improves performance.