states.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. System Power Management Sleep States
  2. (C) 2014 Intel Corp., Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  3. The kernel supports up to four system sleep states generically, although three
  4. of them depend on the platform support code to implement the low-level details
  5. for each state.
  6. The states are represented by strings that can be read or written to the
  7. /sys/power/state file. Those strings may be "mem", "standby", "freeze" and
  8. "disk", where the last one always represents hibernation (Suspend-To-Disk) and
  9. the meaning of the remaining ones depends on the relative_sleep_states command
  10. line argument.
  11. For relative_sleep_states=1, the strings "mem", "standby" and "freeze" label the
  12. available non-hibernation sleep states from the deepest to the shallowest,
  13. respectively. In that case, "mem" is always present in /sys/power/state,
  14. because there is at least one non-hibernation sleep state in every system. If
  15. the given system supports two non-hibernation sleep states, "standby" is present
  16. in /sys/power/state in addition to "mem". If the system supports three
  17. non-hibernation sleep states, "freeze" will be present in /sys/power/state in
  18. addition to "mem" and "standby".
  19. For relative_sleep_states=0, which is the default, the following descriptions
  20. apply.
  21. state: Suspend-To-Idle
  22. ACPI state: S0
  23. Label: "freeze"
  24. This state is a generic, pure software, light-weight, system sleep state.
  25. It allows more energy to be saved relative to runtime idle by freezing user
  26. space and putting all I/O devices into low-power states (possibly
  27. lower-power than available at run time), such that the processors can
  28. spend more time in their idle states.
  29. This state can be used for platforms without Power-On Suspend/Suspend-to-RAM
  30. support, or it can be used in addition to Suspend-to-RAM (memory sleep)
  31. to provide reduced resume latency. It is always supported.
  32. State: Standby / Power-On Suspend
  33. ACPI State: S1
  34. Label: "standby"
  35. This state, if supported, offers moderate, though real, power savings, while
  36. providing a relatively low-latency transition back to a working system. No
  37. operating state is lost (the CPU retains power), so the system easily starts up
  38. again where it left off.
  39. In addition to freezing user space and putting all I/O devices into low-power
  40. states, which is done for Suspend-To-Idle too, nonboot CPUs are taken offline
  41. and all low-level system functions are suspended during transitions into this
  42. state. For this reason, it should allow more energy to be saved relative to
  43. Suspend-To-Idle, but the resume latency will generally be greater than for that
  44. state.
  45. State: Suspend-to-RAM
  46. ACPI State: S3
  47. Label: "mem"
  48. This state, if supported, offers significant power savings as everything in the
  49. system is put into a low-power state, except for memory, which should be placed
  50. into the self-refresh mode to retain its contents. All of the steps carried out
  51. when entering Power-On Suspend are also carried out during transitions to STR.
  52. Additional operations may take place depending on the platform capabilities. In
  53. particular, on ACPI systems the kernel passes control to the BIOS (platform
  54. firmware) as the last step during STR transitions and that usually results in
  55. powering down some more low-level components that aren't directly controlled by
  56. the kernel.
  57. System and device state is saved and kept in memory. All devices are suspended
  58. and put into low-power states. In many cases, all peripheral buses lose power
  59. when entering STR, so devices must be able to handle the transition back to the
  60. "on" state.
  61. For at least ACPI, STR requires some minimal boot-strapping code to resume the
  62. system from it. This may be the case on other platforms too.
  63. State: Suspend-to-disk
  64. ACPI State: S4
  65. Label: "disk"
  66. This state offers the greatest power savings, and can be used even in
  67. the absence of low-level platform support for power management. This
  68. state operates similarly to Suspend-to-RAM, but includes a final step
  69. of writing memory contents to disk. On resume, this is read and memory
  70. is restored to its pre-suspend state.
  71. STD can be handled by the firmware or the kernel. If it is handled by
  72. the firmware, it usually requires a dedicated partition that must be
  73. setup via another operating system for it to use. Despite the
  74. inconvenience, this method requires minimal work by the kernel, since
  75. the firmware will also handle restoring memory contents on resume.
  76. For suspend-to-disk, a mechanism called 'swsusp' (Swap Suspend) is used
  77. to write memory contents to free swap space. swsusp has some restrictive
  78. requirements, but should work in most cases. Some, albeit outdated,
  79. documentation can be found in Documentation/power/swsusp.txt.
  80. Alternatively, userspace can do most of the actual suspend to disk work,
  81. see userland-swsusp.txt.
  82. Once memory state is written to disk, the system may either enter a
  83. low-power state (like ACPI S4), or it may simply power down. Powering
  84. down offers greater savings, and allows this mechanism to work on any
  85. system. However, entering a real low-power state allows the user to
  86. trigger wake up events (e.g. pressing a key or opening a laptop lid).