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

Torstein Sørnes t.soernes at gmail.com
Tue Nov 5 14:51:31 UTC 2024


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),
nodemask=(null),cpuset=/,mems_allowed=0
nov. 05 13:58:32 D2S3Q34 kernel: CPU: 3 UID: 0 PID: 1059 Comm:
zram-generator Not tainted 6.11.5-300.fc41.x86_64 #1
nov. 05 13:58:32 D2S3Q34 kernel: Hardware name: Dell Inc. Latitude
7340/0C5RG2, BIOS 1.17.0 08/12/2024
nov. 05 13:58:32 D2S3Q34 kernel: Call Trace:
nov. 05 13:58:32 D2S3Q34 kernel:  <TASK>
nov. 05 13:58:32 D2S3Q34 kernel:  dump_stack_lvl+0x5d/0x80
nov. 05 13:58:32 D2S3Q34 kernel:  warn_alloc+0x164/0x190
nov. 05 13:58:32 D2S3Q34 kernel:  __vmalloc_node_range_noprof+0x82a/0x870
nov. 05 13:58:32 D2S3Q34 kernel:  ? disksize_store+0x80/0x260 [zram]
nov. 05 13:58:32 D2S3Q34 kernel:  ? __pfx_kfree_link+0x10/0x10
nov. 05 13:58:32 D2S3Q34 kernel:  ? simple_strntoull+0x8a/0xa0
nov. 05 13:58:32 D2S3Q34 kernel:  __vmalloc_node_noprof+0x4e/0x70
nov. 05 13:58:32 D2S3Q34 kernel:  ? disksize_store+0x80/0x260 [zram]
nov. 05 13:58:32 D2S3Q34 kernel:  disksize_store+0x80/0x260 [zram]
nov. 05 13:58:32 D2S3Q34 kernel:  kernfs_fop_write_iter+0x13e/0x1f0
nov. 05 13:58:32 D2S3Q34 kernel:  vfs_write+0x291/0x460
nov. 05 13:58:32 D2S3Q34 kernel:  ksys_write+0x6d/0xf0
nov. 05 13:58:32 D2S3Q34 kernel:  do_syscall_64+0x82/0x160
nov. 05 13:58:32 D2S3Q34 kernel:  ? __count_memcg_events+0x75/0x130
nov. 05 13:58:32 D2S3Q34 kernel:  ? count_memcg_events.constprop.0+0x1a/0x30
nov. 05 13:58:32 D2S3Q34 kernel:  ? handle_mm_fault+0x21b/0x330
nov. 05 13:58:32 D2S3Q34 audit: BPF prog-id=7 op=UNLOAD
nov. 05 13:58:32 D2S3Q34 audit: BPF prog-id=6 op=UNLOAD
nov. 05 13:58:32 D2S3Q34 audit: BPF prog-id=38 op=LOAD
nov. 05 13:58:32 D2S3Q34 audit: BPF prog-id=39 op=LOAD
.....
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),
nodemask=(null),cpuset=/,mems_allowed=0
nov. 05 13:58:32 D2S3Q34 kernel: CPU: 3 UID: 0 PID: 1059 Comm:
zram-generator Not tainted 6.11.5-300.fc41.x86_64 #1
nov. 05 13:58:32 D2S3Q34 kernel: Hardware name: Dell Inc. Latitude
7340/0C5RG2, BIOS 1.17.0 08/12/2024
nov. 05 13:58:32 D2S3Q34 kernel: Call Trace:
nov. 05 13:58:32 D2S3Q34 kernel:  <TASK>
nov. 05 13:58:32 D2S3Q34 kernel:  dump_stack_lvl+0x5d/0x80
nov. 05 13:58:32 D2S3Q34 kernel:  warn_alloc+0x164/0x190
nov. 05 13:58:32 D2S3Q34 kernel:  __vmalloc_node_range_noprof+0x82a/0x870
nov. 05 13:58:32 D2S3Q34 kernel:  ? disksize_store+0x80/0x260 [zram]
nov. 05 13:58:32 D2S3Q34 kernel:  ? __pfx_kfree_link+0x10/0x10
nov. 05 13:58:32 D2S3Q34 kernel:  ? simple_strntoull+0x8a/0xa0
nov. 05 13:58:32 D2S3Q34 kernel:  __vmalloc_node_noprof+0x4e/0x70
nov. 05 13:58:32 D2S3Q34 kernel:  ? disksize_store+0x80/0x260 [zram]
nov. 05 13:58:32 D2S3Q34 kernel:  disksize_store+0x80/0x260 [zram]
nov. 05 13:58:32 D2S3Q34 kernel:  kernfs_fop_write_iter+0x13e/0x1f0
nov. 05 13:58:32 D2S3Q34 kernel:  vfs_write+0x291/0x460
nov. 05 13:58:32 D2S3Q34 kernel:  ksys_write+0x6d/0xf0
nov. 05 13:58:32 D2S3Q34 kernel:  do_syscall_64+0x82/0x160
nov. 05 13:58:32 D2S3Q34 kernel:  ? __count_memcg_events+0x75/0x130
nov. 05 13:58:32 D2S3Q34 kernel:  ? count_memcg_events.constprop.0+0x1a/0x30
nov. 05 13:58:32 D2S3Q34 kernel:  ? handle_mm_fault+0x21b/0x330
nov. 05 13:58:32 D2S3Q34 kernel:  ? do_user_addr_fault+0x55a/0x7b0
nov. 05 13:58:32 D2S3Q34 kernel:  ? exc_page_fault+0x7e/0x180
nov. 05 13:58:32 D2S3Q34 kernel:  entry_SYSCALL_64_after_hwframe+0x76/0x7e
nov. 05 13:58:32 D2S3Q34 kernel: RIP: 0033:0x7fc552663b44
nov. 05 13:58:32 D2S3Q34 kernel: Code: c7 00 16 00 00 00 b8 ff ff ff ff c3
66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 80 3d 25 85 10 00 00 74 13 b8 01
00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 55 48 89>
nov. 05 13:58:32 D2S3Q34 kernel: RSP: 002b:00007ffe1a428ce8 EFLAGS:
00000202 ORIG_RAX: 0000000000000001
nov. 05 13:58:32 D2S3Q34 kernel: RAX: ffffffffffffffda RBX:
0000000000000011 RCX: 00007fc552663b44
nov. 05 13:58:32 D2S3Q34 kernel: RDX: 0000000000000011 RSI:
0000556daf5f3ba0 RDI: 0000000000000004
nov. 05 13:58:32 D2S3Q34 kernel: RBP: 00007ffe1a428ec0 R08:
0000000000000000 R09: 0000000000000011
nov. 05 13:58:32 D2S3Q34 kernel: R10: 00000000000001b6 R11:
0000000000000202 R12: 00007fc552663b30
nov. 05 13:58:32 D2S3Q34 kernel: R13: 7fffffffffffffff R14:
0000556daf5f3ba0 R15: 0000000000000004
nov. 05 13:58:32 D2S3Q34 kernel:  </TASK>
nov. 05 13:58:32 D2S3Q34 kernel: Mem-Info:
nov. 05 13:58:32 D2S3Q34 kernel: active_anon:35693 inactive_anon:0
isolated_anon:0
                                  active_file:17516 inactive_file:17165
isolated_file:0
                                  unevictable:16134 dirty:408 writeback:0
                                  slab_reclaimable:4435
slab_unreclaimable:27034
                                  mapped:8471 shmem:13883 pagetables:854
                                  sec_pagetables:779 bounce:0
                                  kernel_misc_reclaimable:0
                                  free:7946422 free_pcp:13028 free_cma:0
nov. 05 13:58:32 D2S3Q34 kernel: Node 0 active_anon:142772kB
inactive_anon:0kB active_file:70064kB inactive_file:68660kB
unevictable:64536kB isolated(anon):0kB isolated(file):0kB mapped:33884kB
dirty:1632kB writ>
nov. 05 13:58:32 D2S3Q34 kernel: Node 0 DMA free:11264kB boost:0kB min:32kB
low:44kB high:56kB reserved_highatomic:0KB active_anon:0kB
inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB
writepen>
nov. 05 13:58:32 D2S3Q34 kernel: lowmem_reserve[]: 0 1269 31618 0 0
nov. 05 13:58:32 D2S3Q34 kernel: Node 0 DMA32 free:1333468kB boost:0kB
min:2712kB low:4012kB high:5312kB reserved_highatomic:0KB active_anon:0kB
inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0k>
nov. 05 13:58:32 D2S3Q34 kernel: lowmem_reserve[]: 0 0 30348 0 0
nov. 05 13:58:32 D2S3Q34 kernel: Node 0 Normal free:30440956kB boost:0kB
min:64836kB low:95912kB high:126988kB reserved_highatomic:0KB
active_anon:142772kB inactive_anon:0kB active_file:70064kB
inactive_file:686>
nov. 05 13:58:32 D2S3Q34 kernel: lowmem_reserve[]: 0 0 0 0 0
nov. 05 13:58:32 D2S3Q34 kernel: Node 0 DMA: 0*4kB 0*8kB 0*16kB 0*32kB
0*64kB 0*128kB 0*256kB 0*512kB 1*1024kB (U) 1*2048kB (M) 2*4096kB (M) =
11264kB
nov. 05 13:58:32 D2S3Q34 kernel: Node 0 DMA32: 4*4kB (M) 3*8kB (UM) 4*16kB
(M) 5*32kB (M) 5*64kB (M) 4*128kB (M) 5*256kB (UM) 4*512kB (UM) 6*1024kB
(UM) 2*2048kB (UM) 322*4096kB (M) = 1333576kB
nov. 05 13:58:32 D2S3Q34 kernel: Node 0 Normal: 1*4kB (M) 2*8kB (UM) 0*16kB
15*32kB (UME) 45*64kB (UME) 24*128kB (UM) 12*256kB (UM) 14*512kB (UM)
25*1024kB (UM) 17*2048kB (UME) 7413*4096kB (UM) = 30440756kB
nov. 05 13:58:32 D2S3Q34 kernel: Node 0 hugepages_total=0 hugepages_free=0
hugepages_surp=0 hugepages_size=1048576kB
nov. 05 13:58:32 D2S3Q34 kernel: Node 0 hugepages_total=0 hugepages_free=0
hugepages_surp=0 hugepages_size=2048kB
nov. 05 13:58:32 D2S3Q34 kernel: 51119 total pagecache pages
nov. 05 13:58:32 D2S3Q34 kernel: 0 pages in swap cache
nov. 05 13:58:32 D2S3Q34 kernel: Free swap  = 0kB
nov. 05 13:58:32 D2S3Q34 kernel: Total swap = 0kB
nov. 05 13:58:32 D2S3Q34 kernel: 8283316 pages RAM
nov. 05 13:58:32 D2S3Q34 kernel: 0 pages HighMem/MovableOnly
nov. 05 13:58:32 D2S3Q34 kernel: 173505 pages reserved
nov. 05 13:58:32 D2S3Q34 kernel: 0 pages cma reserved
nov. 05 13:58:32 D2S3Q34 kernel: 0 pages hwpoisoned
nov. 05 13:58:32 D2S3Q34 systemd[1]: systemd-zram-setup at zram0.service: Main
process exited, code=exited, status=1/FAILURE
nov. 05 13:58:32 D2S3Q34 systemd[1]: systemd-zram-setup at zram0.service:
Failed with result 'exit-code'.
nov. 05 13:58:32 D2S3Q34 systemd[1]: Failed to start
systemd-zram-setup at zram0.service - Create swap on /dev/zram0.
nov. 05 13:58:32 D2S3Q34 audit[1]: SERVICE_START pid=1 uid=0
auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0
msg='unit=systemd-zram-setup at zram0 comm="systemd"
exe="/usr/lib/systemd/systemd" hostn>
nov. 05 13:58:32 D2S3Q34 systemd[1]: Dependency failed for dev-zram0.swap -
Compressed Swap on /dev/zram0.
nov. 05 13:58:32 D2S3Q34 systemd[1]: dev-zram0.swap: Job
dev-zram0.swap/start failed with result 'dependency'.
nov. 05 13:58:32 D2S3Q34 systemd[1]: Reached target swap.target - Swaps.
```

After starting up, I can execute this series of commands, and successfully
create a 32GB swap:
```
sudo swapoff /dev/zram0
                               sudo zramctl --reset /dev/zram0
                               sudo zramctl --find --size 32G
                               sudo mkswap /dev/zram0
                               sudo swapon /dev/zram0
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20241105/60837033/attachment.htm>


More information about the systemd-devel mailing list