Fix Battery Drain in Suspend Mode on Ubuntu

Change the default suspend variant from s2idle to deep where the system supports suspend-to-RAM.

The Problem

Laptop drains a lot of battery when in sleep mode after upgrade to Ubuntu 24.04.

System logs:

systemd-sleep[]: Performing sleep operation 'suspend'...
kernel: PM: suspend entry (s2idle)

OS version:

$ lsb_release -a
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.2 LTS
Release:	24.04
Codename:	noble

Kernel version:

$ uname -r
6.11.0-17-generic

Sleep configuration:

$ cat /sys/power/mem_sleep
[s2idle] deep

The Solution

Instead of s2idle suspend-to-idle, use deep which means suspend-to-RAM.

Run the following command to set deep sleep mode:

$ echo deep | sudo tee /sys/power/mem_sleep

Create a cron job to set the parameter automatically:

$ echo '#!/bin/bash' | sudo tee /etc/cron.hourly/mem_sleep
$ echo 'echo deep > /sys/power/mem_sleep' | sudo tee -a /etc/cron.hourly/mem_sleep

Verify:

$ cat /sys/power/mem_sleep
s2idle [deep]

Attempt to suspend the system and then verify its logs:

systemd-sleep[]: Performing sleep operation 'suspend'...
kernel: PM: suspend entry (deep)

References

https://www.kernel.org/doc/html/latest/admin-guide/pm/sleep-states.html

Leave a Reply

Your email address will not be published. Required fields are marked *