Swsusp
{{Multiple issues|
{{More citations needed|date=March 2025}}
{{Update|date=October 2016}}
}}
{{lowercase title|swsusp}}
{{Infobox software
| name =
| title = swsusp
| logo =
| logo caption =
| logo_size =
| logo_alt =
| screenshot =
| caption =
| screenshot_size =
| screenshot_alt =
| collapsible =
| author =
| developer =
| released =
| discontinued =
| latest release version =
| latest release date =
| latest preview version =
| latest preview date =
| status =
| programming language = C
| operating system = Linux
| platform =
| size =
| language =
| language count =
| language footnote =
| genre =
| license = GNU General Public License
| website =
}}
swsusp (Software Suspend) is a kernel feature (i.e., program) which is part of power management framework in the Linux kernel.{{Cite web |title=Swap suspend — The Linux Kernel documentation |url=https://www.kernel.org/doc/html/latest/power/swsusp.html |access-date=2025-03-09 |website=www.kernel.org}} It is the default suspend framework as of kernel 3.8.
Objective
SWSUSP helps to drive the system to a low power state (called suspend) when not actively used, while providing the ability to return to the same state as before suspend (called resume/restore).
Features
As of 3.8 Swsusp provides the following options under suspend:
- StandBy: the CPU and main memory (RAM) both are powered up (CPU could be in Wait for Interrupt/WFI)
- Suspend to RAM: the CPU could be powered down while the RAM is up and in Self-refresh state.
- Suspend to Disk: a snapshot of the current system including CPU registers and memory contents are stored in an image in non-volatile memory such as a hard disk and the system is powered down.
For more details on Swsusp refer to kernel documentation under Documentation/power/swsusp.txt
Usage
To enable swsusp, the following should be selected during kernel configuration:
Power management options → <*>Power management support (CONFIG_PM)
Power management options → <*>Software Suspend (CONFIG_SOFTWARE_SUSPEND)
Power management options → [/dev/resume_partition]Default resume partition (CONFIG_PM_STD_PARTITION)
The /dev/resume_partition needs to be replaced by the actual swap partition that is to be used for suspending. Otherwise, resume=/dev/resume_partition can be given as a parameter during system bootup. The actual suspend is done by:
echo shutdown > /sys/power/disk; echo disk > /sys/power/state
You may check other suspend options available by doing
cat /sys/power/state
depending on your kernel config, it will show something similar to [standby] mem disk
and options available under disk can be viewed by
cat /sys/power/disk
depending on your kernel config, it will show something similar to [platform] shutdown reboot
swsusp lacks compression and graphical progress indication, which can be provided through Uswsusp.
See also
- TuxOnIce, is another implementation of suspend to disk and is based on SWSUSP. TuxonIce as of date(30/7/13) is maintained as a patch outside mainline kernel.
- [http://suspend.sf.net/ uswsusp] userspace software for suspending to ram and/or disk