Bugzilla – Bug 1185928
systemd-zram-service multicore handling is deprecated
Last modified: 2022-09-07 01:27:08 UTC
Upon installing 'systemd-zram-service', I noticed it is generating two ZRAM block devices for swap.
Further look at '/sys/block/zram0/max_comp_streams', shows '2' per block device, which is correct for my system.
This is in line with the use of "per CPU compression streams":
Currently the script is trying to do in parallel with ZRAM already having that baked in, even for the older LEAP kernel.
Per cpu number of streams is a significant performance improvement.
The simple fix is deleting the CPU count code and just setting 'num_cpus=1' on both scripts.
Hi Lubos, would you pelase take a look at this issue? I can not find a maintainer for package systemd-zram-service, thanks.
I voted to make a change to this script, as creating zRAM devices based on the number of CPU cores can cause an issue too. See https://github.com/Nefelim4ag/systemd-swap/issues/176
It's a deprecated practice which can do more harm than good.
For anyone who want to fix this issue, you can do this by:
1. Open your file manager as an admin. Mine is: nautilus admin:///
2. Search for zramswapon file, edit the # get the number of CPUs to num_cpus=1.
3. Do the same for zramswapoff file.
4. Reboot your PC. Check zRAM with: sudo zramctl, now you should only have 1 zRAM device.
I have created a request to change the systemd-zram-service package's zramswapon and zramswapoff scripts:
Factory SR 1000767 (https://build.opensuse.org/request/show/1000767) was accepted. The fix is delivered with Tumbleweed's snapshot 20220905.
Sorry, my bad, I see the package is updated when I `sudo zypper dup`. It's updated at the filesystem's repo but hasn't yet made it to the factory. Nevertheless, it should be delivered on Tumbleweed's snapshot soon.