Author Topic: hibernate / resume / suspend-to-disk (STD) doesn't need hardware support?  (Read 4005 times)

pocock

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +32/-0
    • View Profile

I already started another thread here about all the suspend modes, including suspend to RAM and the special modes of the POWER9 architecture.  I'm starting this new thread to focus on hibernate, in other words, suspend-to-disk (STD)

There is a section about hibernation in the official Linux kernel guide.  They state:

Quote
Hibernation

This state (also referred to as Suspend-to-Disk or STD) offers the greatest energy savings and can be used even in the absence of low-level platform support for system suspend.

This means it doesn't matter if POWER9 or the motherboard (Talos II, Blackbird, Condor) have any hardware support for hibernation.  The suspend and resume work is all done by the operating system.

The kernel guide goes on to state:

Quote
However, it requires some low-level code for resuming the system to be present for the underlying CPU architecture.

Is that code already available in any newer kernels?

Is that code available in any alternative operating system like FreeBSD or OpenBSD?

I did a check on one of my own systems and it doesn't appear to support it, disk is missing from the output:


$ cat /sys/power/state
freeze mem


Here is the same command on an Intel host, notice the disk support is listed there:


$ cat /sys/power/state
freeze mem disk


Debian Developer
https://danielpocock.com

tle

  • Sr. Member
  • ****
  • Posts: 463
  • Karma: +53/-0
    • View Profile
    • Trung's Personal Website
I too can confirm Suspend to Disk is missing with Fedora 39 (kernel 6.5.0). So I think this feature is not supported *yet*.

I also tried suspend to RAM on Fedora 39 and it works for me.
Faithful Linux enthusiast

My Raptor Blackbird

MPC7500

  • Hero Member
  • *****
  • Posts: 588
  • Karma: +41/-1
    • View Profile
    • Twitter
That's good news, finally.

Corvidae

  • Newbie
  • *
  • Posts: 25
  • Karma: +11/-0
    • View Profile
I too can confirm Suspend to Disk is missing with Fedora 39 (kernel 6.5.0). So I think this feature is not supported *yet*.

I also tried suspend to RAM on Fedora 39 and it works for me.

If that's true, that would be great. If you do a
Code: [Select]
cat /sys/power/mem_sleep command, what does it show? I'm wondering if the "suspend to RAM" you got is actually just s2idle. It's better than nothing, and if you're able to get out of it by pressing a key then you got further than I did when I last tried it.

I really hope I'm wrong and you actually got real suspend to memory, but my outlook towards suspend on POWER is a bit more cynical after finding that the story for power management on this platform is often "no support". As an example - there is no PCIE power management, so it is impossible to safely put devices in a low-power state. You *might* be able to completely cut power with some OPAL command, but it's been a while since I looked. Even then, IIRC the PCIE spec requires the system to put the device in D3Hot (low power) before going into D3Cold (no power), so that doesn't solve the problem.

Edit: One thing that might not look so bleak - I tried turning all of the suspend-related options back on in my kernel config after reading this, and when I do
Code: [Select]
cat /sys/power/state, I *do* see "disk" in there. I know what I'll be trying this weekend...

tle

  • Sr. Member
  • ****
  • Posts: 463
  • Karma: +53/-0
    • View Profile
    • Trung's Personal Website
Code: [Select]
cat /sys/power/mem_sleep
[s2idle]

It is s2idle... better than nothing I guess

Btw, which kernel config you enabled? Keen to try that on Fedora 39 too
Faithful Linux enthusiast

My Raptor Blackbird

Corvidae

  • Newbie
  • *
  • Posts: 25
  • Karma: +11/-0
    • View Profile
Here are all of the power management/sleep-related config settings I'm using, for completeness:
Code: [Select]
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
# CONFIG_SUSPEND_SKIP_SYNC is not set
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_HIBERNATION_SNAPSHOT_DEV=y
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
CONFIG_PM_SLEEP_SMP_NONZERO_CPU=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_USERSPACE_AUTOSLEEP is not set
CONFIG_PM_WAKELOCKS=y
CONFIG_PM_WAKELOCKS_LIMIT=100
CONFIG_PM_WAKELOCKS_GC=y
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
CONFIG_PM_CLK=y
CONFIG_PM_GENERIC_DOMAINS=y
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
CONFIG_PM_GENERIC_DOMAINS_OF=y
# CONFIG_ENERGY_MODEL is not set

The CONFIG_HIBERNATION* settings are what you are looking for.