Linux PM: Hibernate/Sleep

Hibenate/Sleep

Suspend to Disk(STD) - Hibernate
Suspend to RAM(STR) - Sleep

Standby is a special case of Sleep, it is in simple sleep.
Wakeup is restore system, no matter from Hibernate/Sleep/Standby.

Hibernate will shutdown all the power of system, so must reset Power button to wakeup system.

Sleep will keep RAM in power at least, others something like Mouse/Keyboard, so touch those device can trigger the wakeup procedure.

The device we used for wakeup is called Wakeup Source.

There are 3 layer: API Layer/PM core/PM Driver

/sys/power/state: freeze/mem/disk

freeze: freeze all processes in system include user process and kernel thread, it does not change any Hardware.

standby: simple sleep state

mem: STR(sleep)

disk: STD(hibernate)

/sys/power/pm_trace: CONFIG_PM_TRACE

/sys/power/pm_test: none/core/processors/platform/devices/freezer

its use controlled by CONFIG_PM_DEBUG and the function is suspend_test.

enter_state: suspend_test(TEST_FREEZER);
suspend_devices_and_enter: suspend_test(TEST_DEVICES);
suspend_enter:    suspend_test(TEST_PLATFORM);
        suspend_test(TEST_CPUS);
        suspend_test(TEST_CORE);
/sys/power/wakeup_count:
when system in sleep state, produce a wakeup event then should wake up system.
when system entering into sleep state, produce a wakeup event then should stop the sleep procedure.

/sys/power/disk: shutdown/reboot/suspend
shutdown: through shutdown system to implement the STD, and kernel will call kernel_power_off interface.

reboot: through reboot system to implement the STD, and kernel will call kernel_restart interface.

suspend: through STR function to implement the STD function.

/sys/power/image_size: special for STD. this interface is used for setting or getting how many space needed in memory, which used for buffer data into disk, in byte unit.

/sys/power/reserved_size: special for STD. reserved space in memory.

/sys/power/resume: special for STD. in normal case, when restart the kernel will load the image in disk and restore the system. but the interface supply a method for loading image and restoring system in user space.

/sys/snapshot: special for STD. by character device form supply STD operation in userspace.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值