elogind: don't modify mem_sleep mode by default #58486
Merged
+34
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Testing the changes
Previously systemd implemented
SuspendMode, which elogind extended to allow configuring mem_sleep modes such as s2idle or deep:https://github.com/elogind/elogind/blob/v252.9/src/shared/sleep-config.c#L145-L146
https://github.com/elogind/elogind/blob/v252.9/src/sleep/sleep.c#L252-L287
The
SuspendModeoption was removed from systemd: elogind/elogind@4d28207elogind re-added the option now including default mem_sleep options: elogind/elogind@7707a30 elogind/elogind@b409f71
Previously (in elogind versions we didn't ship), s2idle would be preferred when available which causes issues on laptops where deep is the better option (and the kernel default), in 255.22 this was changed to prefer deep, which conversely causes issues on newer laptops which advertise support for deep despite s2idle being the better option (and the kernel default): elogind/elogind#285
Set the default sleep suspend mode to an empty list to skip modifying
/sys/power/mem_sleepand preserve kernel defaults.This should be fixed with elogind 257.x which drops
SuspendModeconfiguration of mem_sleep in favor of systemd's newly addedMemorySleepMode.This is based on a similar patch in Chimera Linux (although modified to not remove the option outright): https://github.com/chimera-linux/cports/blob/9e7aff96579d41fcc1f411f88526ad7c132f8ec5/main/elogind/patches/sleep.patch