It's pretty simple and easy to use from userspace. See example below (kernel 3.15.7-200.fc20)
# modprobe zram num_devices=4 # zramctl --find --size 10M /dev/zram0 # mkfs.ext2 -q /dev/zram0 # mount /dev/zram0 /mnt/test ./zramctl --find --size 10M --streams 2 /dev/zram1 # mkswap /dev/zram1 Setting up swapspace version 1, size = 10236 KiB no label, UUID=776a95b7-5876-4be4-a66b-9b869cf35bd1 # swapon UUID=776a95b7-5876-4be4-a66b-9b869cf35bd1 # zramctl NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT /dev/zram0 lzo 10M 40K 797B 40K 1 /mnt/test /dev/zram1 lzo 10M 4K 78B 4K 2 [SWAP]
Note that kernel 3.14 does not support more compression streams and algorithms selection.
The next step will be probably to support zram initialization in swapon(8) to
make it easy for users to define swap on zram in /etc/fstab.
No comments:
Post a Comment