I am running Archlinux with kernel 5.7.0-arch1-1 (linux@archlinux), from the 5.4ish kernels, systemd takes ~10 seconds to suspend my laptop. Here are the problems with systemctl suspend:
- Turns networkmanager off immediately.
- Doesn't do anything for 10 seconds or so.
Then it suspends, but when it wakes up:
- Network manager takes a long time to scan and connect to the wifi network.
Solution:
If I do # echo mem > /sys/power/state, it suspends immediately, no networkmanager problem whatsoever. It just works very quickly.
But I am unsure why systemctl suspend takes so long time but echo mem > /sys/power/state takes no time at all.
I have read this but still unsure of the effects of using the echo command directly instead of systemd, to be honest, I am a bit afraid of losing my data (if systemctl suspend flushes any unwritten data to the IO devices) if I do the later.
System Details
cat /proc/version
Linux version 5.7.0-arch1-1 (linux@archlinux) (gcc version 10.1.0 (GCC), GNU ld (GNU Binutils) 2.34.0) #1 SMP PREEMPT Mon, 01 Jun 2020 22:54:03 +0000 free -h
total used free shared buff/cache available Mem: 3.7Gi 1.4Gi 1.4Gi 274Mi 910Mi 1.8Gi Swap: 4.0Gi 0B 4.0Gi cat /proc/swaps
Filename Type Size Used Priority /dev/zram0 partition 4194300 0 -2 Is frequently running the echo command to suspend the system a good choice?