Power management/Guide/ko

최근 몇 년간, 전원 관리 기능은 완벽한 랩톱을 추구하기 위한 과제로서 차별화된 기능이 됐습니다. 아직까지는 운영체제에서 다양한 전원 관리 기능을 지원해야합니다. 이 안내서에서 젠투 설치 과정에서 전원이 부족한 자원을 자동화된 방식으로 유연하게 설정하는 방법을 다루겠습니다.

이 문서 정보
이 문서는 랩톱의 전원 관리 기능을 다룹니다. 비록 이 안내서에서 다루는 내용의 일부가 서버의 전원관리에 적용할 수 있긴 하지만, 그런 용도로 문서를 작성한건 아닙니다. 랩톱이 아닌 시스템에 적용할 때는 주의를 기울이십시오.

이 문서의 주된 목적은 완벽한 기능을 제공하는 랩톱 모드 도구를 갖추는 것입니다. 그러나 우리는 개별 설정에 있어 더 자세한 관점으로 접근하려 다른 도구도 참고합니다. 각각의 경우, 랩톱 모드 도구에서 기능을 비활성화하여 동일한 자원을 다루는 문제에 있어 각 도구가 문제를 일으키지 않게 해야합니다.

laptop_mode 란
laptop_mode 설정은 디스크의 회전수 속성을 줄여(그리고 대기중인 작업을 처리한 후 바로 동작 상태로 복귀하지 않음) 입출력을 최적화하는 커널 설정입니다.

laptop-mode-tools 란
Laptop Mode Tools는 사용자로 하여금 전원 절약 기능을 최적화하는 프로그램 꾸러미 입니다. 커널에서 laptop_mode 설정을 관리할 수 있지만, 시스템의 다른 전원 관련 설정을 조절할 수도 있습니다.

최소한의 커널 설정
포티지에는 제각기 다른 커널 소스 코드가 존재합니다. 사용을 추천합니다만, 고급 최대 절전 기능을 사용한다면 커널이 필요합니다. 적당한 전원 관리 기능을 리눅스 커널에서 활성화하려면, 다음 설정을 활성화하십시오:

CPU에 맞는 CPU 주파수 스케일링 드라이버는 위에 언급한 ACPI Processor P-States driver 바로 다음에 있습니다.

(필요한 경우) 새 커널을 빌드하고 설치한 다음, 다시 부팅하십시오.

설치
It comes to no surprise that installation of the Laptop Mode Tools software is easily done through emerge app-laptop/laptop-mode-tools. However, this package takes on additional, optional settings through USE flag configuration. So let's first take a look at the supported USE flags and what they mean to the package.

As you can see, there are two USE flags that seem to collide:  and. So what is the deal?


 * The  USE enables support for Advanced Power Management, an older (before year 2000) standard for power management features within a system.
 * The  USE enables support for Advanced Configuration and Power Interface, the successor of APM. All modern laptops support ACPI.

시스템에 따라  또는  를 설정해야합니다. 이 안내서의 나머지 부분에서는, 독자 여러분의 랩톱이 최근 널리 사용하는 ACPI를 사용한다고 가정하겠습니다.

자, 이 USE 플래그를 설정하고 나면, 를 설치하십시오:

설정
를 시스템에 설치하고 나면 필요할 지도 모르는 전원 관리 기능이 자동으로 활성화되지 않습니다. 이 꾸러미를 설정하려면 우선  를 살펴보십시오. 이 파일은 꾸러미의 주 설정 파일이며, 설명이 (주석으로) 상당히 잘 달려있습니다.

But it is not the only configuration file to work with. The laptop-mode-tools package supports plugins (or modules) which have their own configuration file(s). These files are located in and are named after the module they represent (such as ).

Now, one of the important settings in each configuration file is if the laptop-mode-tools package should govern a particular setting or not. This is important when you want to combine laptop-mode-tools with other services like cpufreqd. In this example case, you will need to set  :

The next few sections will help the user configure laptop-mode-tools to suit specific needs. When finished, start the laptop_mode service and make sure it is started upon system boot.

laptop-mode-tools 동작 방식
When running the laptop_mode service, the software will check in which state the system is in. The states are defined as:


 * Battery, which is active when the system is running on battery power; the configuration files use the  prefix for settings related to this state;
 * AC, which is active when the system is running on AC power; the configuration files use the  prefix for settings related to this state;
 * Laptop Mode, which is active when laptop mode is enabled; the configuration files use the  prefix for settings related to this state;
 * No Laptop Mode, which is active when laptop mode is disabled; the configuration files use the  prefix for settings related to this state.

The  and   prefixes can be combined (so you can have a   prefix).

When the laptop_mode service is started, it will switch modes based on events that occur (and of course based on the configuration settings). For instance, the setting  will make sure that the laptop mode tools switch to laptop mode when battery power is used. If that is the case, then the settings starting with,  ,  , and   will be used.

To make sure settings to not collide, it is not allowed to have overlapping settings. In the next example, the first set (for ) is valid, but the second one (for  ) is not.

Configuring CPU frequency management
The support for CPU frequency management in the laptop mode tools allows switching frequencies. It supports setting the CPU frequency governor, minimum frequency and maximum frequency. The configuration file used here is

The CPU frequency governor is a kernel-level policy that defines how the kernel will select the CPU frequency. We already selected the governors we want to use in the kernel configuration earlier. Let's recap:


 * always picks the highest frequency;
 * always picks the lowest frequency;
 * does not pick anything, but lets the user decide (or any process that the user is running that will decide for the user);
 * will scale the CPU frequency up to the highest frequency when load is available;
 * will scale the CPU frequency up gradually when load is available.

When switching between AC or battery, or (no) laptop mode, the appropriate governor (as well as its minimum and maximum frequency) is selected.

화면 밝기 설정
With, the laptop mode tools can govern the brightness of the LCD screen.

The file currently uses the file (bug 499544) to set brightness values. Recent kernels do not provide this anymore; it will need to adjust this to instead.

The possible values that can be used are between 0 and the value in, with 0 being the lowest brightness value.

기타 서비스 설정
An interesting feature of laptop-mode-tools is to support reloading particular services (like the system logger) after switching its configuration file. This is handled through

If enabled, the laptop_mode application will switch the configuration file(s) of the mentioned services with the same file, but suffixed with,  or. It will then signal or reload the appropriate services so they can use the new configuration file.

설치
The cpufreqd application allows the user to manage CPU frequencies in a more granular approach than what laptop-mode-tools supports. But before we dive into the installation of cpufreqd, let us first look at the USE flags it supports.

,,   USE 플래그가 겹치므로 이 중 하나만 활성화해야 합니다. 랩톱이 충분히 최근 모델이라면  가 가장 좋습니다. 그렇지 않다면 가 필요한 모든 기능을 제공합니다. APM을 지원하지 않으면 를 사용해보십시오.

USE 플래그를 설정했으면 를 설치할 시간입니다.

설정
The cpufreqd application monitors the status of the system through several plugins. Based on the feedback it receives from those plugins, it will adjust the policy used to govern the CPU frequency.

cpufreqd can be configured by editing It contains three different sections:


 * 1) The   section contains general configuration information
 * 2) The   section defines the policies that the cpufreqd daemon can switch to. The section is very similar to the information you use when manually setting the CPU frequency policy using cpufreq-set.
 * 3) The   section is the work-horse of the cpufreqd daemon, defining when the daemon decides to switch to a different profile.

예제 규칙을 간단하게 살펴보겠습니다.

In the above example, cpufreqd will switch the system to the On Demand High profile (also shown in the above excerpt). This profile by itself uses the ondemand governor with a minimum frequency of 40% (iow, a CPU of 2 GHz will have by this policy a minimum frequency of 800 MHz).

As you can see, the cpufreqd application can offer a more granular approach on CPU frequency scaling. But not only that, you can tweak the CPU frequency scaling based on various other metrics available. The default configuration offers a sample rule for when you watch a movie, where you want maximum performance, unless the CPU temperature is getting too high.

When you have configured cpufreqd, it is time to start it (and make sure the service is loaded automatically). Make sure that CPU frequency handling by other tools (like laptop-mode-tools) is disabled!

도구

 * Laptop Mode Tools Homepage, includes About laptop mode.
 * PowerTOP, an interactive application helping users to find out which processes are forcing wakeups on the CPU most often.

Articles and Guides

 * A ThinkWiki article on How to reduce power consumption (on Linux). This article offers an exhaustive list of measures one can take. However, it should be noted that the laptop mode tools implements the majority of these (if properly configured).