Much Faster Suspend & Resume For Some Systems With Linux 6.14

Written by Michael Larabel in Linux Kernel on 25 January 2025 at 07:19 AM EST. 24 Comments
LINUX KERNEL
Alongside the power management and thermal driver updates this week for the ongoing Linux 6.14 kernel cycle were also the ACPI updates. The ACPI pull request was worth calling out on its own thanks to a change that will allow for faster suspend and resume cycles on some systems with this new kernel.

The ACPI change worth highlighting for Linux 6.14 is switching from msleep() to usleep_range() within the acpi_os_sleep() call in the kernel. This reduces spurious sleep time due to timer inaccuracy. Linux ACPI/PM maintainer Rafael Wysocki of Intel who authored this change noted that it could "spectacularly" reduce the duration of system suspend and resume transitions on some systems.

Among the many systems affected are for this bug report from July 2022 over Thunderbolt on Dell XPS laptops taking 8 seconds to suspend and 8 seconds to resume. Another report suggesting this ACPI change noted another Dell XPS laptop going from a kernel resume time of 1.9 seconds down to 1.1 seconds.

Dell XPS laptop with Linux


Rafael explained in the patch making the sleep change:
"The extra delay added by msleep() to the sleep time value passed to it can be significant, roughly between 1.5 ns on systems with HZ = 1000 and as much as 15 ms on systems with HZ = 100, which is hardly acceptable, at least for small sleep time values.

msleep(5) on the default HZ = 250 in Ubuntu on a modern PC takes about 12 ms. This results in over 800 ms of spurious system resume delay on systems such as the Dell XPS-13-9300, which use ASL Sleep(5ms) in a tight loop.

Address this by using usleep_range() in acpi_os_sleep() instead of msleep(). For short sleep times this is a no brainer, but even for long sleeps usleep_range() should be preferred because timer wheel timers are optimized for cancelation before they expire and this particular timer is not going to be canceled."

This suspend and resume improvement was merged as part of the ACPI updates for the Linux 6.14 kernel.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week