Score:1

How to change /sys/power/mem_sleep? Nothing is able to change it and all advice so far seems to be wrong?

in flag

I can not change.

It seems locked.

Want to put to lower power state.

s2idle [deep]

How is this done. Google search hits discussion not all possible paths to change correctly.

UPDATE:

What people say is usually wrong:

For example, this is what happens:

$ echo s2idle | sudo tee /sys/power/mem_sleep
s2idle
$ cat /sys/power/mem_sleep
[s2idle]

Is my system broken compared to the example below that results in deep!???? Or is that a typo on their part? There is confusion like this all over the web.

Why does this fail?

echo deep | sudo tee /sys/power/mem_sleep
deep
tee: /sys/power/mem_sleep: Invalid argument

My suspsicion is that people are writing answers that trigger some latent thing ... but they do not understand what that thing is or how to change it's settings. Is it grub?

And this seems relevant https://forums.linuxmint.com/viewtopic.php?t=335139

UPDATE:

The problem appears to have been a BIOS setting. Set config power sleep state to Linux!

Doug Smythies avatar
gn flag
If I understand your updates correctly, at first you did not have the `deep` option due to a BIOS setting that made it not available at the linux OS level. I assume that after making a change in that BIOS setting, the `deep` option is now available?
Score:2
gn flag

(OP addition): First make sure your BIOS->config->power-sleep state is correct (or whatever it is called). It should be set to Linux. Default is probably windows. Not having this set properly can block you from setting [deep].

/sys/power/mem_sleep indicates the method of suspend that will used. Availability of the various methods is system dependant.

The typical default is deep, as you have shown:

doug@s19:~$ cat /sys/power/mem_sleep
s2idle [deep]

meaning Suspend-to-RAM would be used if mem was written to /sys/power/state to suspend the system.

By changing it to s2idle:

doug@s19:~/system-info$ echo s2idle | sudo tee /sys/power/mem_sleep
s2idle
doug@s19:~/system-info$ cat /sys/power/mem_sleep
[s2idle] deep

Then Suspend-To-Idle would be used if mem was written to /sys/power/state to suspend the system.

The other way to tell the system which method of suspend to use is via the /sys/power/state itself. The options for a given system can be listed:

doug@s19:~$ cat /sys/power/state
freeze mem disk

freeze can be used for Suspend-To-Idle and mem can be used for Suspend-to-RAM, depending on the setting in /sys/power/mem_sleep.

Suspend-To-Idle will wake from suspend faster, but uses a lot more power than Suspend-to-RAM. For my test server, the mains power for a very idle system is about 37.8 Watts. Suspend-To-Idle uses about 29.4 Watts. Suspend-to-RAM uses about 2.8 Watts. I used these commands to suspend the system:

doug@s19:~$ echo freeze | sudo tee /sys/power/state
freeze
doug@s19:~$ echo mem | sudo tee /sys/power/state
mem

And pushed the power button to wake the system.

Reference.

mathtick avatar
in flag
Ok, but how to change to s3idle [deep]? It's non-trivial to use sudo tee IMO ... maybe some lock is the explain? And one needs some escape. I have two machines, one is setup with [deep] and the other not. I imagine I did something to get it in this state.
mathtick avatar
in flag
ongoing mystery https://askubuntu.com/questions/1400517/why-doesnt-sudo-cp-copy-files-in-the-sys-directory
mathtick avatar
in flag
more https://ubuntuforums.org/showthread.php?t=2135632
mathtick avatar
in flag
more confusiong https://askubuntu.com/questions/1434722/macbook-takes-20-seconds-to-wake-up/1434727#1434727 ... still unclear what is the intended thing.
mathtick avatar
in flag
chatgpt seems to think one should edit grub menu /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mem_sleep_default=s2idle"
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.