[systemd-devel] Fwd: System fails to create zram on startup, but I can do so manually

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Nov 20 14:58:57 UTC 2024


On Thu, Nov 07, 2024 at 07:35:43PM +0100, Michal Koutný wrote:
> Hello Torstein.
> 
> On Tue, Nov 05, 2024 at 03:51:31PM GMT, Torstein Sørnes <t.soernes at gmail.com> wrote:
> > I have a Fedora 41 laptop with 32GB of ram.
> > 
> > On startup, this shows in the journal:
> > ```
> > nov. 05 13:58:32 D2S3Q34 zram-generator[1059]: Error: Failed to configure
> > disk size into /sys/block/zram0/disksize
> > nov. 05 13:58:32 D2S3Q34 zram-generator[1059]: Caused by:
> > nov. 05 13:58:32 D2S3Q34 zram-generator[1059]:     Cannot allocate memory
> > (os error 12)
> > nov. 05 13:58:32 D2S3Q34 kernel: zram-generator: vmalloc error: size
> > 131072000000000, exceeds total pages, mode:0xdc0(GFP_KERNEL|__GFP_ZERO),
>   ^^^^^^^^^^^^^^^
> This value looks suspicious.

The value specified as 'zram-size' is in megabytes. To specify 32GB, you
need to say '32*1024'.

The parsing of suffixes was a bit accidental. We originally had
simpler parser that only parsed ints, and then when fasteval was added
to parse formulas, I guess we didn't consider how suffixes would be
handled. I don't think we can change this now, because this was
documented behaviour and people may have used something like '4k'
to get 4000 MB. I think the nice backwards-compatible solution would
be to add a new setting, e.g. disk-size that is evaluated as bytes,
and soft-deprecate zram-size.

Zbyszek


More information about the systemd-devel mailing list