Power management/Guide/fr

Dans les dernières années, la gestion de l'énergie est devenue l'une des fonctionnalités discriminante dans le recherche du parfait ordinateur portable. Encore faut-il que le système d'exploitation prenne en charge les nombreuses fonctionnalités d'économie d'énergie également. Dans ce guide, nous couvrons la manière de configurer votre installation de Gentoo pour qu'elle gère les ressources énergivores d'une manière automatique et flexible.

À propos de ce document...
Ce document décrit la configuration de la gestion d'énergie sur votre ordinateur portable. Bien que quelques unes des informations fournies dans ce guide s'appliquent aussi aux serveurs, ce n'est pas l'objectif de ce document que de couvrir ce cas. Soyez donc prudent lorsque vous appliquerez ce guide à autre chose qu'un ordinateur portable.

Dans ce document, nous nous focaliserons en priorité sur l'outil laptop_mode du portable car il offre un jeu complet de fonctionnalités. Néanmoins, nous nous référerons également à d'autres outils qui sont susceptibles d'offrir une approche plus fine sur certains réglages individuels. Dans de tels cas, vous devrez désactiver la fonctionnalité de l'outil laptop_mode de l'ordinateur portable, de manière à ce que les deux outils n'entrent pas en conflit pour la gestion de la même ressource.

À propos du laptop_mode (mode ordinateur portable)
Le paramètre   du noyau permet l'optimisation des entrées/sorties, en autorisant les disques à se mettre au ralenti proprement (et à ne pas être réveillés aussitôt lors d'opération en files).

À propes des outils du laptop-mode
Les outils du Laptop Mode  constituent un paquet et permettent à l'utilisateur d'optimiser les fonctions d'économie d'énergie. Ils permettent de gérer le réglage du   dans le noyau Linux, mais possède des fonctionnalités additionnelles pour peaufiner d'autres réglages en relation avec l'énergie sur le système.

Configuration minimum du noyau
Différentes sources du noyau sont disponibles dans Portage. Nous recommandons d'utiliser les , mais si vous désirez la prise en charge du  mode avancé d'hibernation, vous pouvez avoir besoin des. Pour activer une gestion de l'énergie digne de ce nom dans le noyau Linux, activez au minimum les réglages suivants :

N'oubliez pas d'activer le pilote d'adaptation de fréquence (frequency scaling driver) du CPU pour votre modèle de CPU. Il se trouve juste après les ACPI Processor P-States driver cités plus haut.

Compilez et installez le nouveau noyau (si besoin) et redémarrez.

Installation
Les outils du mode laptop_mode s'installe via le paquet. Néanmoins, ce paquet accepte des réglages additionnels via les options de la variable USE. Commençons donc par jeter un coup d'œil à ces options :

Comme vous pouvez le voir, il y a deux options de la variable USE qui semble entrer en conflit :  et. Que faut-il faire ici ?


 * L'option  de la variable USE active la prise en charge de  Advanced Power Management (Gestion avancée de l'énergie), un ancien standard (avant 2000) pour les fonctionnalités de gestion de l'énergie dans un système.
 * L'option  de la variable USE active la prise en charge de l'Advanced Configuration and Power Interface (Configuration avancée et Interface énergie), le successeur  d'APM. Tous les portables modernes prennent en charge l'ACPI.

Selon votre système, vous aurez besoin, soit de , soit de. Dans la suite de ce guide, nous supposons que votre portable est assez récent pour prendre l'ACPI en charge.

Une fois les options de la variable USE définies, installons le paquet.

Configuration
Having  installed on your system does not automatically enable the power management features that you might need. To configure the package, first take a look at. This is the main configuration file for the package and is pretty well described (through comments).

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  with other services like. In this example case, you will need to set  :

The next few sections will help you configure  to suit your needs. When you are finished, start the  service and make sure it is started when you boot up your system.

How does laptop-mode-tools work
When running the  service, the software will check in which state your 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  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 settigns. In the next example, the first set (for  ) is valid, but the second one (for   ) isn't.

Colliding settings

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 let 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.

Configuring display brightness
With, you can have the laptop mode tools govern the brightness of your LCD screen.

The file currently uses the file to set brightness values. Recent kernels do not provide this anymore - you will need to adjust this to instead.

The values you can use are between 0 and 15, with 0 being the lowest brightness value.

Configuring other services
An interesting feature of  is to support reloading particular services (like the system logger) after switching its configuration file. This is handled through.

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

Installation
The  application allows you to manage CPU frequencies in a more granular approach then what   supports. But before we dive into the installation of , let's first look at the USE flags it supports.

The USE flags ,   and   overlap, so you should only have one active. If your laptop is sufficiently recent,  is your best bet. If not,  offers all that is needed. When even APM isn't supported, you can try.

With the USE flags configured, it is time to install.

Configuration
The  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.

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   daemon can switch to. The section is very similar to the information you use when manually setting the CPU frequency policy using.
 * 3) The   section is the work-horse of the   daemon, defining when the daemon decides to switch to a different profile.

Let's take a quick look at an example rule.

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

As you can see, the  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 , it is time to start it (and make sure the service is loaded automatically). Make sure that CPU frequency handling by other tools (like  ) is disabled!

Tools

 * 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).

Acknowledgements
We would like to thank the following authors and editors for their contributions to this guide:


 * swift