Pinebook Pro boot time much longer after enabling zram

I have enabled zram using the zram-generator package from the repos and setting it to ram/2
The boot time is much longer now. I’ll post the comparison below:

Before zram

systemd-analyze critical-chain
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
graphical.target @8.881s
└─multi-user.target @8.880s
  └─tailscaled.service @7.486s +1.393s
    └─NetworkManager.service @7.284s +151ms
      └─network-pre.target @7.270s
        └─firewalld.service @5.532s +1.724s
          └─polkit.service @5.544s +87ms
            └─basic.target @5.396s
              └─sockets.target @5.394s
                └─dbus.socket @5.393s
                  └─sysinit.target @5.329s
                    └─systemd-resolved.service @4.959s +361ms
                      └─systemd-tmpfiles-setup.service @4.600s +282ms
                        └─systemd-journal-flush.service @3.623s +873ms
                          └─var-log.mount @3.187s +144ms
                            └─dev-mmcblk2p2.device @584ms +2.519s

After enabling zram

systemd-analyze critical-chain 
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
graphical.target @55.205s
└─multi-user.target @55.204s
  └─tailscaled.service @53.831s +1.371s
    └─NetworkManager.service @53.605s +187ms
      └─network-pre.target @53.598s
        └─firewalld.service @51.986s +1.608s
          └─polkit.service @52.008s +96ms
            └─basic.target @51.741s
              └─sockets.target @51.739s
                └─dbus.socket @51.737s
                  └─sysinit.target @51.663s
                    └─systemd-resolved.service @51.282s +370ms
                      └─systemd-tmpfiles-setup.service @50.910s +242ms
                        └─systemd-journal-flush.service @50.219s +672ms
                          └─var-log.mount @50.186s +22ms
                            └─dev-mmcblk2p2.device @49.405s +761ms

Any ideas on what is happening here?

What does blame show? critical-chain doesn’t seem helpful in this case.

1 Like

Before zram

https://clbin.com/27UVV

After zram

https://clbin.com/Jfd7D

How much RAM do you have in total?

4 GB actual RAM + 2 GB from zram

Heres inxi
https://clbin.com/6DHgw

Could be a temporary issue?
Blame doesn’t show the same issue…

It’s happening consistent on every boot. Basically it gets stuck on

Welcome to Endeavouros!

for one minute

Do you mean the Welcome app?

image

1 Like

Not sure how zram is implemented… But if it takes “away” any real RAM, then that may be the problem on such a machine with small amount of RAM.

It tries to compress stuff that goes into RAM. But it shouldn’t effect boot process.

I already have it running fine on a Odroid N2+ with 4 GB RAM.
It has no problem there.

From the Arch wiki:

The zram kernel module (previously called compcache) provides a compressed block device in RAM. If you use it as swap device, the RAM can hold much more information but uses more CPU. Still, it is much quicker than swapping to a hard drive. If a system often falls back to swap, this could improve responsiveness. Using zram is also a good way to reduce disk read/write cycles due to swap on SSDs.

Maybe compression uses much more CPU power on that machine?

But it should compress anything on boot. zram doesn’t get used from the start as far as i know. It kicks in only when more than 50% of RAM is used, which doesn’t happen on boot.

Does this make any sense?

Since it (=zswap) is enabled by default, disable zswap if you decide to use zram to avoid zswap acting as a swap cache in front of it.

1 Like

I don’t think zram-generator packages enables zwap. Let me dig into it. Thanks for the idea. I was thinking about this yesterday too but it skipped me somehow.

I added zswap.enabled=0 to kernel parameters and it didn’t help

1 Like

Note that I haven’t used zram so my comments are based on what I just read on the Arch wiki.
Hopefully you’ll find the reason and a solution! :sweat_smile:

EDIT: maybe this gives some ideas: https://wiki.archlinux.org/title/Improving_performance#Improving_system_responsiveness_under_low-memory_conditions