[systemd-devel] Fwd: System fails to create zram on startup, but I can do so manually
Torstein Sørnes
t.soernes at gmail.com
Wed Nov 20 15:03:22 UTC 2024
I have now set it to
```
[zram0]
zram-size = 32*1024
```
and tried
```
sudo systemctl daemon-reload
sudo systemctl restart systemd-zram-setup at zram0
```
But it fails with
```
Job for systemd-zram-setup at zram0.service failed because the control process
exited with error code.
See "systemctl status systemd-zram-setup at zram0.service" and "journalctl
-xeu systemd-zram-setup at zram0.service" for details.
nov. 20 16:01:21 D2S3Q34 systemd[1]: Starting
systemd-zram-setup at zram0.service - Create swap on /dev/zram0...
nov. 20 16:01:21 D2S3Q34 zram-generator[162009]: Error: Failed to configure
disk size into /sys/block/zram0/disksize
nov. 20 16:01:21 D2S3Q34 zram-generator[162009]: Caused by:
nov. 20 16:01:21 D2S3Q34 zram-generator[162009]: Device or resource
busy (os error 16)
nov. 20 16:01:21 D2S3Q34 systemd[1]: systemd-zram-setup at zram0.service: Main
process exited, code=exited, status=1/FAILURE
nov. 20 16:01:21 D2S3Q34 systemd[1]: systemd-zram-setup at zram0.service:
Failed with result 'exit-code'.
nov. 20 16:01:21 D2S3Q34 systemd[1]: Failed to start
systemd-zram-setup at zram0.service - Create swap on /dev/zram0.
```
On Wed, Nov 20, 2024 at 3:59 PM Zbigniew Jędrzejewski-Szmek <
zbyszek at in.waw.pl> wrote:
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20241120/0739cdec/attachment.htm>
More information about the systemd-devel
mailing list