Power Management Interface for System Sleep

8 篇文章 0 订阅
Power Management Interface for System Sleep

Copyright (c) 2016 Intel Corp., Rafael J. Wysocki <rafael.j.wysocki@intel.com>
电源管理子系统为用户空间提供统一的sysfs接口
The power management subsystem provides userspace with a unified sysfs interface
for system sleep regardless of the underlying system architecture or platform.
The interface is located in the /sys/power/ directory (assuming that sysfs is
mounted at /sys).

/sys/power/state is the system sleep state control file.

Reading from it returns a list of supported sleep states(支持列表), encoded as:
'freeze' (Suspend-to-Idle)强制
'standby' (Power-On Suspend)可选
'mem' (Suspend-to-RAM)可选
'disk' (Suspend-to-Disk)强制


Suspend-to-Idle is always supported.  Suspend-to-Disk is always supported
too as long the kernel has been configured to support hibernation at all
(ie. CONFIG_HIBERNATION is set in the kernel configuration file).  Support
for Suspend-to-RAM and Power-On Suspend depends on the capabilities of the
platform.

If one of the strings listed in /sys/power/state is written to it, the system
will attempt to transition into the corresponding sleep state.  Refer to
Documentation/admin-guide/pm/sleep-states.rst for a description of each of
those states.

 
 
/sys/power/disk:
/sys/power/disk controls the operating mode of hibernation (Suspend-to-Disk).
Specifically, it tells the kernel what to do after creating a hibernation image.

Reading from it returns a list of supported options encoded as:

'platform' (put the system into sleep using a platform-provided method)
'shutdown' (shut the system down)
'reboot' (reboot the system)
'suspend' (trigger a Suspend-to-RAM transition)
'test_resume' (resume-after-hibernation test mode)

The currently selected option is printed in square brackets.

The 'platform' option is only available if the platform provides a special
mechanism to put the system to sleep after creating a hibernation image (ACPI
does that, for example).  The 'suspend' option is available if Suspend-to-RAM
is supported.  Refer to Documentation/power/basic-pm-debugging.txt for the
description of the 'test_resume' option.

To select an option, write the string representing it to /sys/power/disk.

/sys/power/image_size controls the size of hibernation images.

It can be written a string representing a non-negative integer that will be
used as a best-effort upper limit of the image size, in bytes.  The hibernation
core will do its best to ensure that the image size will not exceed that number.
However, if that turns out to be impossible to achieve, a hibernation image will
still be created and its size will be as small as possible.  In particular,
writing '0' to this file will enforce hibernation images to be as small as
possible.

Reading from this file returns the current image size limit, which is set to
around 2/5 of available RAM by default.

/sys/power/pm_trace controls the PM trace mechanism saving the last suspend
or resume event point in the RTC across reboots.

It helps to debug hard lockups or reboots due to device driver failures that
occur during system suspend or resume (which is more common) more effectively.

If /sys/power/pm_trace contains '1', the fingerprint of each suspend/resume
event point in turn will be stored in the RTC memory (overwriting the actual
RTC information), so it will survive a system crash if one occurs right after
storing it and it can be used later to identify the driver that caused the crash
to happen (see Documentation/power/s2ram.txt for more information).

Initially it contains '0' which may be changed to '1' by writing a string
representing a nonzero integer into it.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值