Try creating /etc/systemd/sleep.conf
:
[Sleep]
SuspendMode=
SuspendState=mem
And reboot. This seems to be working for me, although I'm not certain I didn't also get improvement with the /etc/systemd/logind.conf
change I did first. In any case, no heat or fan noise is observed while suspended with the lid shut, and it doesn't respond to ping over wifi either, which I had been getting, intermittently, before.
Battery life still goes down while suspended, probably because the working method of suspend is just less efficient than the default, ideal, method that apparently isn't working properly, but it appears better than the default behaviour.
Tried on my XPS 13 9370, I don't know about older models, although it seems likely they'll be similar.
I had tried installing pm-utils
and using pm-suspend
and that seemed to be suspending pretty effectively, so I wanted to see if I could make systemd-suspend
do the same thing.
I looked through the scripts in pm-utils
to figure out what it was actually doing, and it looks like, in this situation, it was doing echo -n "mem" > /sys/power/state
. So I created the /etc/systemd/sleep.conf
file as shown above to match it.
It's not entirely clear what the default behaviour is. The manpage for systemd-sleep.conf
says that the distro should include /etc/systemd/sleep.conf
with the compiled-in defaults commented out, so you can see this information, but in ubuntu this file is missing. I noticed though that if you cat /sys/power/state
you get:
freeze mem
So I'm guessing that this is what it's doing by default. My guess is that freeze
may be being accepted, in that it doesn't throw an error, which would otherwise cause systemd to move on to mem
, but maybe doesn't actually work properly, or reliably, for complex reasons we seem unable to determine. So just sending mem
instead is a hopeful stab at avoiding that and just doing what pm-suspend
does.
I suspect the SuspendMode setting is actually superfluous and doesn't do anything anyway. I suspect this because cat /sys/power/disk
just gets you:
[disabled]
Am new user, thus unable to comment with an observation, forced to present it as an answer as if I'm super-confident in it! But I think it's working.