目录
总体流程
休眠流程
- User requests for software suspend
- All the running processes are given the
suspend
signal - The devices are frozen so that they don’t change the system state when the snapshot is taken
- The memory image is atomically copied with interrupts disabled
- Frozen devices are awakened so that the image can be written
- The image is written to swap
- Devices are suspended and the system powered off
以上流程中红色部分代码,会导致在休眠过程中屏幕先灭再亮。
根据linux kernel官网文档 Documentation/driver-api/pm/devices.rst的描述,休眠包括以下5个阶段
The general procedure for hibernation is
1) to quiesce all devices ("freeze"),
2)create an image of the system memory while everything is stable,
3)reactivate all devices ("thaw"),
4) write the image to permanent storage,
5)and finally shut down the system ("power off").
The phases used to accomplish this are: ``prepare``,
``freeze``, ``freeze_late``, ``freeze_noirq``, ``thaw_noirq``, ``thaw_early``,
&