# How can I set laptop's "mem\_sleep" to "sleep" instead of "s2idle" to save more battery?

**URL:** <https://forums.rockylinux.org/t/how-can-i-set-laptops-mem-sleep-to-sleep-instead-of-s2idle-to-save-more-battery/7590>\
**Category:** Rocky Linux Help & Support\
**Created:** [October 19, 2022, 7:29am UTC](https://forums.rockylinux.org/t/how-can-i-set-laptops-mem-sleep-to-sleep-instead-of-s2idle-to-save-more-battery/7590 "2022-10-19T07:29:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![idet2](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@idet2](https://forums.rockylinux.org/u/idet2)\
**Post date:** [October 19, 2022, 7:29am UTC](https://forums.rockylinux.org/t/how-can-i-set-laptops-mem-sleep-to-sleep-instead-of-s2idle-to-save-more-battery/7590/1 "2022-10-19T07:29:14Z")

</div>

Hello Rocky community!

I was recently given a Dell Precision 3561 from my work and have installed Rocky Linux 9 (5.14.0-70.26.1.el9\_0.x86\_64) on it and I am using KDE X11 desktop environment.

A few days ago I was working on battery mode closed the lid and was expecting the laptop to be in deep sleep state but apparently that was not the case because when I turned it back on battery was drained. Did a new test by fully charging the battery, removed the power adapter, closed the lid and waited for an hour or so and the battery had dropped to 20% almost.

Checking what power states the system supports I get the following:

```auto
cat /sys/power/state 
freeze mem

```

```auto
cat /sys/power/mem_sleep
[s2idle]

```

As far as I can understand the `s2idle` is the least capable power saving mode. Is there something I can do or look for in order to save battery while in sleep mode? Like any BIOS setting to look for and adjust? Any other pointers?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![prasad](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/prasad/32/1606_2.png) [@prasad](https://forums.rockylinux.org/u/prasad)\
**Post date:** [October 19, 2022, 9:02am UTC](https://forums.rockylinux.org/t/how-can-i-set-laptops-mem-sleep-to-sleep-instead-of-s2idle-to-save-more-battery/7590/2 "2022-10-19T09:02:05Z")

</div>

Click on the KDE battery icon (or search for Power Management) and you can select the action to perform when laptop lid is closed.

Check this [KDE wiki](https://userbase.kde.org/System_Settings/Power_Management) for more details

---

<div class="post-metadata">

**Author:** ![idet2](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@idet2](https://forums.rockylinux.org/u/idet2)\
**Post date:** [October 19, 2022, 9:50am UTC](https://forums.rockylinux.org/t/how-can-i-set-laptops-mem-sleep-to-sleep-instead-of-s2idle-to-save-more-battery/7590/3 "2022-10-19T09:50:42Z")

</div>

Hi! Thanks for taking the time to reply to my question.

I have already done that but apparently the sleep mode (shown by `mem_sleep` above) that is supported (`s2idle`) is not saving enough battery. I should have had something else there like `sleep` there I suppose.

Since the title may be confusing I will try to update it to something more explanatory.

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [October 19, 2022, 10:29am UTC](https://forums.rockylinux.org/t/how-can-i-set-laptops-mem-sleep-to-sleep-instead-of-s2idle-to-save-more-battery/7590/4 "2022-10-19T10:29:54Z")

</div>

According to this: [https://www.kernel.org/doc/Documentation/power/states.txt](https://www.kernel.org/doc/Documentation/power/states.txt) the valid options are:

- s2idle
- shallow
- deep
- disk

obviously s2idle is not great, because it’s a software option that doesn’t rely on any hardware-related power management options.

For example, on my laptop:

```auto
[root@elise ian]# cat /sys/power/mem_sleep 
s2idle [deep]

```

as you can see mine does actually show a hardware option that is in use and available. That said, this is Fedora 36, so not sure why yours isn’t showing anything else. Could well be that the kernel doesn’t recognise your power management hardware or perhaps other power management packages installed.

You could try enabling elrepo:

```auto
dnf install elrepo-release

```

and then install the mainline kernel, which is kernel 6.x, rather than the default 5.x kernel that comes with RHEL9/Rocky9.

```auto
dnf install kernel-ml --enablerepo=elrepo-kernel

```

reboot and see if that provides any other suspend options.

---

<div class="post-metadata">

**Author:** ![idet2](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@idet2](https://forums.rockylinux.org/u/idet2)\
**Post date:** [October 19, 2022, 11:16am UTC](https://forums.rockylinux.org/t/how-can-i-set-laptops-mem-sleep-to-sleep-instead-of-s2idle-to-save-more-battery/7590/5 "2022-10-19T11:16:21Z")

</div>

Hello @iwalker .

Tried that but got the below error:

```auto
INFO dkms: running auto installation service for kernel 6.0.2-1.el9.elrepo.x86_64
Sign command: /lib/modules/6.0.2-1.el9.elrepo.x86_64/build/scripts/sign-file
Binary /lib/modules/6.0.2-1.el9.elrepo.x86_64/build/scripts/sign-file not found, modules won't be signed
Error! Your kernel headers for kernel 6.0.2-1.el9.elrepo.x86_64 cannot be found at /lib/modules/6.0.2-1.el9.elrepo.x86_64/build or /lib/modules/6.0.2-1.el9.elrepo.x86_64/source.
Please install the linux-headers-6.0.2-1.el9.elrepo.x86_64 package or use the --kernelsourcedir option to tell DKMS where it's located.
 Done. 
dkms: running auto installation service for kernel 6.0.2-1.el9.elrepo.x86_64
Sign command: /lib/modules/6.0.2-1.el9.elrepo.x86_64/build/scripts/sign-file
Binary /lib/modules/6.0.2-1.el9.elrepo.x86_64/build/scripts/sign-file not found, modules won't be signed
Error! Your kernel headers for kernel 6.0.2-1.el9.elrepo.x86_64 cannot be found at /lib/modules/6.0.2-1.el9.elrepo.x86_64/build or /lib/modules/6.0.2-1.el9.elrepo.x86_64/source.
Please install the linux-headers-6.0.2-1.el9.elrepo.x86_64 package or use the --kernelsourcedir option to tell DKMS where it's located.
 Done. 

```

Then tried to do : `dnf install kernel-ml kernel-ml-headers --enablerepo=elrepo-kernel`  
resulted in the following:

```auto
Error: Transaction test error:
  file /usr/include/asm-generic/fcntl.h from install of kernel-ml-headers-6.0.2-1.el9.elrepo.x86_64 conflicts with file from package kernel-headers-5.14.0-70.26.1.el9_0.x86_64
  file /usr/include/asm-generic/mman-common.h from install of kernel-ml-headers-6.0.2-1.el9.elrepo.x86_64 conflicts with file from package kernel-headers-5.14.0-70.26.1.el9_0.x86_64
  file /usr/include/asm-generic/poll.h from install of kernel-ml-headers-6.0.2-1.el9.elrepo.x86_64 conflicts with file from package kernel-headers-5.14.0-70.26.1.el9_0.x86_64
  file /usr/include/asm-generic/shmbuf.h from install of kernel-ml-headers-6.0.2-1.el9.elrepo.x86_64 

(etc. etc. etc.)

```

---

<div class="post-metadata">

**Author:** ![idet2](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@idet2](https://forums.rockylinux.org/u/idet2)\
**Post date:** [October 19, 2022, 11:21am UTC](https://forums.rockylinux.org/t/how-can-i-set-laptops-mem-sleep-to-sleep-instead-of-s2idle-to-save-more-battery/7590/6 "2022-10-19T11:21:33Z")

</div>

Forget about that…my bad…

I should have used `kernel-ml-devel` instead of `headers` .

Let’s reboot now to see what’s going to happen…

---

<div class="post-metadata">

**Author:** ![idet2](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@idet2](https://forums.rockylinux.org/u/idet2)\
**Post date:** [October 19, 2022, 3:04pm UTC](https://forums.rockylinux.org/t/how-can-i-set-laptops-mem-sleep-to-sleep-instead-of-s2idle-to-save-more-battery/7590/7 "2022-10-19T15:04:26Z")

</div>

Unfortunately I wasn’t able to successfully boot in the new kernel.

The first time the `kernel-ml` was installed it couldn’t be loaded due to Secure Boot (most probably). I was getting the below error after selecting it at GRUB:

```auto
error: ../../grub-core/kern/efi/sb.c:183:bad shim signature.
error: ../../grub-core/loader/i386/efi/linux.c:233:you need to load the kernel first.

Press any key to continue...

```

So I decided to go the long way of trying to sign the new kernel, which I believe I was successful because the kernel started to boot but a few seconds after (~4sec) it was stopped as soon as the USB keyboard was detected.

I guess this has to do with the disk being encrypted since in the previous kernel at that point it was asking for the LUKS password of the encrypted disk.

With `kernel-ml` it just stayed there without being able to type anything.

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:37am UTC](https://forums.rockylinux.org/t/how-can-i-set-laptops-mem-sleep-to-sleep-instead-of-s2idle-to-save-more-battery/7590/8 "2023-08-25T03:37:11Z")

</div>

Closed on August 25, 2023, 3:37am UTC


