Today I tried to setup some ZRAM into my main system.
I followed this page: https://wiki.gentoo.org/wiki/Zram
And did actually this step: https://wiki.gentoo.org/wiki/Zram#Using_systemd_zramctl
Which on my system, this was made:
Code: Select all
Mephistopheles ~ # modprobe zram
Mephistopheles ~ # zramctl /dev/zram0 --size 4G --algorithm lz4
Mephistopheles ~ # swapoff -a
Mephistopheles ~ # mkswap /dev/zram0
Configure l'espace d'échange (swap) en version 1, taille = 4 GiB (4294963200 octets)
pas d'étiquette, UUID=8b1bddbb-8c9a-4adb-80eb-0d3e2528cc88
Mephistopheles ~ # swapon /dev/zram0
Now, I have effectively a 4GiB swap space:
Code: Select all
meself@Mephistopheles ~ $ LC_ALL=C free -m
total used free shared buff/cache available
Mem: 15905 12687 2612 3976 4910 3217
Swap: 4095 4095 0
I tried to check if it was effectively used as intented, as showed on the Zram wiki page:
Code: Select all
$ grep zram /proc/swaps
/dev/zram0 partition 4194300 3391232 -2
I'm a bit perplexe, since I see a swap space in /dev/zram0 as set earlier (see my example above).
I guess something is not understood by me.
---
Second question, isn't this zram actually zswap ?
As explained on the ZSwap page on the wiki: https://wiki.gentoo.org/wiki/Zswap
I'm in big doubt, because I followed the ZRam page and ended up with new swap space, as it seems compressed into my RAM.Next to zswap there is something related called zram. Zram can also be used to create a swap device for compressed pages in memory.
Could you help me understand this, please ?
Regards,
GASPARD DE RENEFORT Kévin


