after installing systemd-swap and enabling zram. data entering zram is not compressed. and also the amount of data in zram that I receive with the “cat / sys / block / zram (0-1) / mm_stat” command is less than the amount of data received with the “swapon - -show” command. what could be the problem? why is the data not compressed? how can this be fixed?
Maybe your original data is already compressed?
Can you paste the contents of mm_stat file?
[victor@ ~]$ swapon --show NAME TYPE SIZE USED PRIO /dev/zram0 partition 391,8M 34,1M 32767 /dev/zram1 partition 391,8M 34,2M 32767 [victor@ ~]$ cat /sys/block/zram0/mm_stat 17539072 17535034 17539072 0 17539072 0 0 4281 [victor@ ~]$ cat /sys/block/zram1/mm_stat 18698240 18694202 18698240 0 18698240 0 0 4564
I did some tests and found that the data is actually being compressed, the information in the mm_stat file is displayed incorrectly. it looks like a bug. and on another distribution on the same version of the kernel, I did not notice such behavior.
Great catch! Can you post mm_stat from the other distribution?
From Void Linux 5.8
murloc@~$ swapon --show NAME TYPE SIZE USED PRIO /dev/zram0 partition 512M 118,8M 10 /dev/zram1 partition 512M 119M 10 murloc@~$ cat /sys/block/zram0/mm_stat 124260352 29869704 31735808 0 82841600 3314 600 568 murloc@~$ cat /sys/block/zram1/mm_stat 124719104 29537634 31158272 0 31510528 3510 51 571