Public bug reported: Using zram-config on a system with a sufficiently high count of CPUs causes the systemd service to fail. The reason being that there is a cap on the amount of swap devices that can be allocated. Zram is properly allocated, but the systemd service fails since some devices cannot be allocated. Below is the output of the service.
The fix should be simple enough (but I'm not proficient with git patches yet). The script at /usr/bin/init-zram-swapping currently takes the number of CPUs and creates this many devices to enable parallelization. The simplest fix would be to set a max number of devices. An alternative would be to use a smaller number of devices, but enable multiple threads on each device. My understanding is that this is now possible, but I'm not sure which method is more performant. ... Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635155]: Setting up swapspace version 1, size = 1.5 GiB (1582292992 b> Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635155]: no label, UUID=e340a051-f250-4d5c-b43a-8ba8c711dc14 Sep 09 08:39:42 ubuntu-server kernel: Adding 1545208k swap on /dev/zram25. Priority:5 extents:1 across:1545208k SSFS Sep 09 08:39:42 ubuntu-server kernel: zram26: detected capacity change from 0 to 1582297088 Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635175]: Setting up swapspace version 1, size = 1.5 GiB (1582292992 b> Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635175]: no label, UUID=95e21e29-4626-4780-a162-88e06c606171 Sep 09 08:39:42 ubuntu-server kernel: Adding 1545208k swap on /dev/zram26. Priority:5 extents:1 across:1545208k SSFS Sep 09 08:39:42 ubuntu-server kernel: zram27: detected capacity change from 0 to 1582297088 Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635192]: Setting up swapspace version 1, size = 1.5 GiB (1582292992 b> Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635192]: no label, UUID=c927bbd5-c446-438e-acc9-b5ce9960ccdc Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635193]: swapon: /dev/zram27: swapon failed: Operation not permitted Sep 09 08:39:42 ubuntu-server kernel: zram28: detected capacity change from 0 to 1582297088 Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635196]: Setting up swapspace version 1, size = 1.5 GiB (1582292992 b> Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635196]: no label, UUID=3561d65c-a821-40e7-af6c-48752bce7522 Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635198]: swapon: /dev/zram28: swapon failed: Operation not permitted Sep 09 08:39:42 ubuntu-server kernel: zram29: detected capacity change from 0 to 1582297088 Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635200]: Setting up swapspace version 1, size = 1.5 GiB (1582292992 b> Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635200]: no label, UUID=41bd94f8-bdd2-43dd-b68f-e54062d70849 Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635205]: swapon: /dev/zram29: swapon failed: Operation not permitted Sep 09 08:39:42 ubuntu-server kernel: zram30: detected capacity change from 0 to 1582297088 Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635209]: Setting up swapspace version 1, size = 1.5 GiB (1582292992 b> Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635209]: no label, UUID=44e288ac-9492-409f-933c-41772adb907c Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635212]: swapon: /dev/zram30: swapon failed: Operation not permitted Sep 09 08:39:42 ubuntu-server kernel: zram31: detected capacity change from 0 to 1582297088 Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635216]: Setting up swapspace version 1, size = 1.5 GiB (1582292992 b> Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635216]: no label, UUID=98669a26-7e16-4359-a535-c71532629f93 Sep 09 08:39:42 ubuntu-server init-zram-swapping[1635218]: swapon: /dev/zram31: swapon failed: Operation not permitted Sep 09 08:39:42 ubuntu-server systemd[1]: zram-config.service: Main process exited, code=exited, status=255/EXCEPTION System Config: ❯ lscpu ... CPU(s): 32 On-line CPU(s) list: 0-31 Thread(s) per core: 2 Core(s) per socket: 8 Socket(s): 2 NUMA node(s): 2 ... Model name: Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz ** Affects: zram-config (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1895002 Title: zram-config attempts to allocate more devices than permitted To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/zram-config/+bug/1895002/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs