<div dir="ltr">I have now set it to<br>```<br>[zram0]<br>zram-size = 32*1024<br>```<br>and tried<br>```<br>sudo systemctl daemon-reload <br>sudo systemctl restart systemd-zram-setup@zram0<br>```<br>But it fails with<br>```<br>Job for systemd-zram-setup@zram0.service failed because the control process exited with error code.<br>See "systemctl status systemd-zram-setup@zram0.service" and "journalctl -xeu systemd-zram-setup@zram0.service" for details.<br>nov. 20 16:01:21 D2S3Q34 systemd[1]: Starting systemd-zram-setup@zram0.service - Create swap on /dev/zram0...<br>nov. 20 16:01:21 D2S3Q34 zram-generator[162009]: Error: Failed to configure disk size into /sys/block/zram0/disksize<br>nov. 20 16:01:21 D2S3Q34 zram-generator[162009]: Caused by:<br>nov. 20 16:01:21 D2S3Q34 zram-generator[162009]: Device or resource busy (os error 16)<br>nov. 20 16:01:21 D2S3Q34 systemd[1]: systemd-zram-setup@zram0.service: Main process exited, code=exited, status=1/FAILURE<br>nov. 20 16:01:21 D2S3Q34 systemd[1]: systemd-zram-setup@zram0.service: Failed with result 'exit-code'.<br>nov. 20 16:01:21 D2S3Q34 systemd[1]: Failed to start systemd-zram-setup@zram0.service - Create swap on /dev/zram0.<br>```<br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 20, 2024 at 3:59 PM Zbigniew Jędrzejewski-Szmek <<a href="mailto:zbyszek@in.waw.pl">zbyszek@in.waw.pl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Nov 07, 2024 at 07:35:43PM +0100, Michal Koutný wrote:<br>
> Hello Torstein.<br>
> <br>
> On Tue, Nov 05, 2024 at 03:51:31PM GMT, Torstein Sřrnes <<a href="mailto:t.soernes@gmail.com" target="_blank">t.soernes@gmail.com</a>> wrote:<br>
> > I have a Fedora 41 laptop with 32GB of ram.<br>
> > <br>
> > On startup, this shows in the journal:<br>
> > ```<br>
> > nov. 05 13:58:32 D2S3Q34 zram-generator[1059]: Error: Failed to configure<br>
> > disk size into /sys/block/zram0/disksize<br>
> > nov. 05 13:58:32 D2S3Q34 zram-generator[1059]: Caused by:<br>
> > nov. 05 13:58:32 D2S3Q34 zram-generator[1059]: Cannot allocate memory<br>
> > (os error 12)<br>
> > nov. 05 13:58:32 D2S3Q34 kernel: zram-generator: vmalloc error: size<br>
> > 131072000000000, exceeds total pages, mode:0xdc0(GFP_KERNEL|__GFP_ZERO),<br>
> ^^^^^^^^^^^^^^^<br>
> This value looks suspicious.<br>
<br>
The value specified as 'zram-size' is in megabytes. To specify 32GB, you<br>
need to say '32*1024'.<br>
<br>
The parsing of suffixes was a bit accidental. We originally had<br>
simpler parser that only parsed ints, and then when fasteval was added<br>
to parse formulas, I guess we didn't consider how suffixes would be<br>
handled. I don't think we can change this now, because this was<br>
documented behaviour and people may have used something like '4k'<br>
to get 4000 MB. I think the nice backwards-compatible solution would<br>
be to add a new setting, e.g. disk-size that is evaluated as bytes,<br>
and soft-deprecate zram-size.<br>
<br>
Zbyszek<br>
</blockquote></div>