Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-doc-cvs
Navigation:
Lists: gentoo-doc-cvs: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-doc-cvs@g.o
From: "Sven Vermeulen (swift)" <swift@g.o>
Subject: gentoo commit in xml/htdocs/doc/en: power-management-guide.xml
Date: Fri, 23 Sep 2011 18:41:52 +0000 (UTC)
swift       11/09/23 18:41:52

  Modified:             power-management-guide.xml
  Log:
  Fix bugs #379523 and #381059, rewrite power management guide reflecting recent developments in userspace support

Revision  Changes    Path
1.49                 xml/htdocs/doc/en/power-management-guide.xml

file : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/power-management-guide.xml?rev=1.49&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/power-management-guide.xml?rev=1.49&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/power-management-guide.xml?r1=1.48&r2=1.49

Index: power-management-guide.xml
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- power-management-guide.xml	17 Aug 2011 07:19:29 -0000	1.48
+++ power-management-guide.xml	23 Sep 2011 18:41:52 -0000	1.49
@@ -1,109 +1,74 @@
 <?xml version='1.0' encoding="UTF-8"?>
 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.48 2011/08/17 07:19:29 swift Exp $ -->
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.49 2011/09/23 18:41:52 swift Exp $ -->
 
 <guide>
 <title>Power Management Guide</title>
 
 <author title="Author">
-  <mail link="earthwings@g.o">Dennis Nienhüser</mail>
-</author>
-<author title="Editor">
-  <mail link="chriswhite@g.o">Chris White</mail>
-</author>
-<author title="Editor">
-  <mail link="nightmorph"/>
+  <mail link="swift"/>
 </author>
 
 <abstract>
-Power Management is the key to extend battery run time on mobile systems like
-laptops. This guide assists you setting it up on your laptop.
+In recent years, power management has become one of the differentiating
+features in the quest for finding the perfect laptop. Yet, the operating system
+must support the various power saving functionalities too. In this guide, we
+cover how to setup your Gentoo installation so it manages power-hungry resources
+in a flexible yet automated manner.
 </abstract>
 
 <!-- The content of this document is licensed under the CC-BY-SA license -->
 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
 <license/>
 
-<version>4</version>
-<date>2011-08-17</date>
+<version>5</version>
+<date>2011-09-22</date>
 
 <chapter>
 <title>Introduction</title>
 <section>
+<title>About this document...</title>
 <body>
 
-<!-- 
-     Remove this note after 6 months - ETA 01/02/2012
-     By then, we can assume that OpenRC migrations are not that frequent
-     anymore and this note can be dropped.
-     ~ Sven Vermeulen
--->
-<impo>
-Since the introduction of OpenRC, the <c>pmg_switch_runlevel.sh</c> script
-needs to be updated. If you have issues after the OpenRC upgrade, please update
-this script according to this guide.
-</impo>
+<p>
+This document describes the setup of power management features on your laptop.
+Although some of the information in this guide can be applied to power
+management for servers, it is not the intention of this document to go that
+route. Please be careful when applying this on a non-laptop system.
+</p>
 
 <p>
-Capacity and lifetime of laptop batteries have improved much in the last years.
-Nevertheless modern processors consume much more energy than older ones and
-each laptop generation introduces more devices hungry for energy. That's why
-Power Management is more important than ever. Increasing battery run time
-doesn't necessarily mean buying another battery. Much can be achieved applying
-intelligent Power Management policies.
+Within this document, we will focus primarily on the laptop mode tools since it
+offers a complete set of functionalities. However, we will also refer to other
+tools that might offer a more detailed approach on individual settings. In such
+cases, you will need to disable the feature from the laptop mode tools so that
+both tools do not fight over the same resource control.
 </p>
 
 </body>
 </section>
 <section>
-<title>A Quick Overview</title>
+<title>About laptop_mode</title>
 <body>
 
 <p>
-Please notice that this guide describes Power Management for <e>laptops</e>.
-While some sections might also suite for <e>servers</e>, others do not and may
-even cause harm. Please do not apply anything from this guide to a server
-unless you really know what you are doing.
-</p>
-
-<p>
-As this guide has become rather long, here's a short overview helping you to
-find your way through it.
-</p>
-
-<p>
-The <uri link="#doc_chap2">Prerequisites</uri> chapter talks about some
-requirements that should be met before any of the following device individual
-sections will work. This includes BIOS settings, kernel configuration and some
-simplifications in user land. The following three chapters focus on devices
-that typically consume most energy - processor, display and hard drive. Each
-can be configured separately. <uri link="#doc_chap3">CPU Power Management</uri>
-shows how to adjust the processor's frequency to save a maximum of energy
-without losing too much performance. A few different tricks prevent your hard
-drive from working unnecessarily often in <uri link="#doc_chap5">Disk Power
-Management</uri> (decreasing noise level as a nice side effect). Some notes on
-graphics cards, Wireless LAN and USB finish the device section in <uri
-link="#doc_chap6">Power Management For Other Devices</uri> while another
-chapter is dedicated to the (rather experimental) <uri link="#doc_chap7">sleep
-states</uri>. Last not least <uri link="#doc_chap8">Troubleshooting</uri> lists
-common pitfalls.
+The <c>laptop_mode</c> setting is an in-kernel configuration setting that
+optimizes I/O, allowing disks to spin down properly (and not be woken up
+immediately afterwards for queued operations).
 </p>
 
 </body>
 </section>
 <section>
-<title>Power Budget For Each Component</title>
+<title>About laptop-mode-tools</title>
 <body>
 
-<figure link="/images/energy-budget.png" short="Which component consumes how
-much energy?" caption="Power budget for each component"/>
-
 <p>
-Nearly every component can operate in different states - off, sleep, idle,
-active to name a few - consuming a different amount of energy. Major parts are
-consumed by the LCD display, CPU, chipset and hard drives. Often one is able to
-activate OS-independent Power Management in the BIOS, but an intelligent setup
-in the operating system adapting to different situations can achieve much more.
+The <e>Laptop Mode Tools</e> is a software package
+(<c>app-laptop/laptop-mode-tools</c>) which allows the user to optimize power
+saving functions. It allows managing the <c>laptop_mode</c> setting in the Linux
+kernel, but has additional features allowing you to tweak other power-related
+settings on the system.
 </p>
 
 </body>
@@ -111,881 +76,566 @@
 </chapter>
 
 <chapter>
-<title>Prerequisites</title>
+<title>Linux Kernel Configuration</title>
 <section>
+<title>Minimum kernel setup</title>
 <body>
 
 <p>
-Before discussing the details of making individual devices Power Management
-aware, make sure certain requirements are met. After controlling BIOS settings,
-some kernel options want to be enabled - these are in short ACPI, sleep states
-and CPU frequency scaling. As power saving most of the time comes along with
-performance loss or increased latency, it should only be enabled when running
-on batteries. That's where a new runlevel <e>battery</e> comes in handy.
+There are different kernel sources in Portage. We recommend using
+<c>gentoo-sources</c>, but if you want advanced hibernation support you might
+need <c>tuxonice-sources</c>. To enable proper power management features in the
+Linux kernel, enable at least the following settings:
 </p>
 
-</body>
-</section>
-<section>
-<title>The BIOS Part</title>
-<body>
+<pre caption="Minimum kernel setup for Power Management (Kernel 2.6)">
+<![CDATA[
+General setup --->
+  [*] Configure standard kernel features (expert users) --->
+
+Power management and ACPI options --->
+  [*] ACPI (Advanced Configuration and Power Interface) Support --->
+    <*> AC Adapter
+    <*> Battery
+    -*- Button
+    -*- Video
+    <*> Fan
+    <*> Processor
+    <*> Thermal Zone
+    [*] Power Management Timer Support
+
+  [*] CPU Frequency scaling --->
+    [*] CPU Frequency scaling
+    <*>   'performance' governor
+    <*>   'powersave' governor
+    <*>   'userspace' governor
+    <*>   'ondemand' governor
+    <*>   'conservative' governor
+    <*> ACPI Processor P-States driver
+]]>
+</pre>
 
 <p>
-First have a look into your BIOS Power Management settings. The best way is to
-combine BIOS and operating system policies, but for the moment it's better to
-disable most of the BIOS part. This makes sure it doesn't interfere with your
-policies. Don't forget to re-check BIOS settings after you configured
-everything else.
+Don't forget to enable the CPU frequency scaling driver for your CPU, located
+right after the <e>ACPI Processor P-States driver</e> mentioned above.
 </p>
 
-</body>
-</section>
-<section>
-<title>Setting USE Flags</title>
-<body>
-
 <p>
-Please check that the <c>acpi</c> USE flag is set in
-<path>/etc/make.conf</path>. Other USE flags that might be interesting for your
-system are <c>apm</c>, <c>lm_sensors</c>, <c>nforce2</c>, <c>nvidia</c>,
-<c>pmu</c>. See <path>/usr/portage/profiles/use*.desc</path> for details. If
-you forgot to set one of these flags, you can recompile affected packages using
-the <c>--newuse</c> flag in <c>emerge</c>, see <c>man emerge</c>.
+Build and install the new kernel (if necessary) and reboot.
 </p>
 
 </body>
 </section>
-<section>
-<title>Configuring The Kernel</title>
+<!--
+<section id="kernelconfig">
+<title>Additional kernel configuration entries</title>
 <body>
 
 <p>
-ACPI (Advanced Configuration and Power Interface) support in the kernel is
-still work in progress. Using a recent kernel will make sure you'll get the
-most out of it.
+Further down this guide, additional kernel settings might be suggested. To
+lessen the effort to maintain the guide, and to make sure settings are correctly
+identified, we will use the kernel configuration short-hand notations. These
+notations are simple strings, like <c>CONFIG_USB_SUSPEND</c>. But how to read
+this?
 </p>
 
 <p>
-There are different kernel sources in Portage. I'd recommend using
-<c>gentoo-sources</c> or <c>tuxonice-sources</c>. The latter contains patches
-for TuxOnIce, see the chapter about <uri link="#doc_chap7">sleep states</uri>
-for more details. When configuring the kernel, activate at least these options:
+Well, then you configure your kernel (through <c>make menuconfig</c>), you can
+search through the configuration settings for a particular entry. Press <c>/</c>
+while configuring the Linux kernel and type the setting
+(<c>CONFIG_USB_SUSPEND</c>). The software will tell you what the setting is,
+what it is for, when you can select it (i.e. on which settings it depends before
+you can see it) but most importantly, where you can find it.
 </p>
 
-<pre caption="Minimum kernel setup for Power Management (Kernel 2.6)">
-Power management and ACPI options ---&gt;
-[*] Power Management support
-  [ ] Software Suspend
-
-  ACPI( Advanced Configuration and Power Interface ) Support ---&gt;
-    [ ]   Deprecated /proc/acpi/ files
-    [*]   AC Adapter
-    [*]   Battery
-    &lt;M&gt;   Button
-    &lt;M&gt;   Video
-    [ ]   Generic Hotkey
-    &lt;M&gt;   Fan
-    &lt;M&gt;   Processor
-    &lt;M&gt;     Thermal Zone
-    &lt; &gt;   ASUS/Medion Laptop Extras
-    &lt; &gt;   IBM ThinkPad Laptop Extras
-    &lt; &gt;   Toshiba Laptop Extras
-    (0)   Disable ACPI for systems before Jan 1st this year
-    [ ]   Debug Statements
-    [*]   Power Management Timer Support
-    &lt; &gt;   ACPI0004,PNP0A05 and PNP0A06 Container Driver (EXPERIMENTAL)
-
-  CPU Frequency Scaling ---&gt;
-    [*] CPU Frequency scaling
-    [ ]   Enable CPUfreq debugging
-    &lt; &gt;   CPU frequency translation statistics
-    [ ]     CPU frequency translation statistics details
-          Default CPUFreq governor (userspace)
-    &lt;*&gt;   'performance' governor
-    &lt;*&gt;   'powersave' governor
-    &lt;*&gt;   'ondemand' cpufreq policy governor
-    &lt;*&gt;   'conservative' cpufreq governor
-    &lt;*&gt;   CPU frequency table helpers
-    &lt;M&gt; ACPI Processor P-States driver
-    &lt;*&gt; <i>CPUFreq driver for your processor</i>
+<pre caption="Result of a search operation during menuconfig">
+<![CDATA[Symbol: USB_SUSPEND [=n]
+Type  : boolean
+Prompt: USB runtime power management (autosuspend) and wakeup
+  Defined at drivers/usb/core/Kconfig:93
+  Depends on: USB_SUPPORT [=y] && USB [=y] && PM_RUNTIME [=n]
+  Location:
+    -> Device Drivers
+      -> USB support (USB_SUPPORT [=y])
+        -> Support for Host-side USB (USB [=y]) ]]>
 </pre>
 
-<p>
-Decide yourself whether you want to enable Software Suspend, and Sleep States
-(see below). If you own an ASUS, Medion, IBM Thinkpad or Toshiba laptop, enable
-the appropriate section.
-</p>
+</body>
+</section>
+-->
+</chapter>
+
+<chapter>
+<title>Using Laptop Mode Tools</title>
+<section>
+<title>Installation</title>
+<body>
 
 <p>
-The kernel has to know how to enable CPU frequency scaling on your processor.
-As each type of CPU has a different interface, you've got to choose the right
-driver for your processor. Be careful here - enabling <c>Intel Pentium 4 clock
-modulation</c> on a Pentium M system will lead to strange results for example.
-Consult the kernel documentation if you're unsure which one to take.
+It comes to no surprise that installation of the <e>Laptop Mode Tools</e>
+software is easily done through <c>emerge laptop-mode-tools</c>. 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.
 </p>
 
+<table>
+<tr>
+  <th>USE flag</th>
+  <th>Description</th>
+  <th>Suggested when...</th>
+</tr>
+<tr>
+  <ti>acpi</ti>
+  <ti>
+    Depend on <c>sys-power/acpid</c> so that changes in the system are
+    captured and power saving features are automatically enabled/disabled.
+  </ti>
+  <ti>your laptop is not too old (~ year 2003 and later)</ti>
+</tr>
+<tr>
+  <ti>apm</ti>
+  <ti>
+    Depend on <c>sys-apps/apmd</c> so that changes in the system are captured
+    and power saving features are automatically enabled/disabled.
+  </ti>
+  <ti>your laptop is very old</ti>
+</tr>
+<tr>
+  <ti>bluetooth</ti>
+  <ti>
+    Depend on <c>net-wireless/bluez</c>, enabling the <c>laptop-mode-tools</c>
+    to manage bluetooth settings (enabling/disabling the service based on
+    battery availability)
+  </ti>
+  <ti>your laptop (and kernel) supports bluetooth</ti>
+</tr>
+<tr>
+  <ti>scsi</ti>
+  <ti>
+    Depend on <c>sys-apps/sdparm</c>, enabling the <c>laptop-mode-tools</c> to
+    manage SCSI (<e>and not</e> SATA) disk parameters.
+  </ti>
+  <ti>your laptop uses SCSI disks</ti>
+</tr>
+</table>
+
 <p>
-Compile your kernel, make sure the right modules get loaded at startup and boot
-into your new ACPI-enabled kernel. Next run <c>emerge sys-power/acpid</c> to
-get the acpi daemon. This one informs you about events like switching from AC
-to battery or closing the lid. Make sure the modules are loaded if you didn't
-compile them into the kernel and start acpid by executing <c>/etc/init.d/acpid
-start</c>. Run <c>rc-update add acpid default</c> to load it on startup. You'll
-soon see how to use it.
+As you can see, there are two USE flags that seem to collide: <c>acpi</c> and
+<c>apm</c>. So what's the deal there?
 </p>
 
-<pre caption="Installing acpid">
-# <i>emerge sys-power/acpid</i>
-# <i>/etc/init.d/acpid start</i>
-# <i>rc-update add acpid default</i>
-</pre>
+<ul>
+  <li>
+    The <c>apm</c> USE flag enables support for <e>Advanced Power
+    Management</e>, an older (before year 2000) standard for power management
+    features within a system.
+  </li>
+  <li>
+    The <c>acpi</c> USE flag enables support for <e>Advanced Configuration and
+    Power Interface</e>, the successor of APM. All modern laptops support ACPI.
+  </li>
+</ul>
 
-</body>
-</section>
-<section>
-<title>Creating A "battery" Runlevel</title>
-<body>
+<p>
+Depending on your system, you will either need <c>acpi</c> or <c>apm</c> set. In
+the remainder of this guide, we assume that your laptop is recent enough to use
+ACPI.
+</p>
 
 <p>
-The default policy will be to enable Power Management only when needed -
-running on batteries. To make the switch between AC and battery convenient,
-create a runlevel <c>battery</c> that holds all the scripts starting and
-stopping Power Management.
+So, with the USE flags set, let's install <c>laptop-mode-tools</c>.
 </p>
 
 <note>
-You can safely skip this section if you don't like the idea of having another
-runlevel. However, skipping this step will make the rest a bit trickier to set
-up. The next sections assume a runlevel <c>battery</c> exists.
+If you have USE="acpi" set, the installation will pull in <c>acpid</c>. However,
+the current stable ACPI daemon (2.0.9) does not support the new ACPI interfaces
+within the Linux kernel (using the netlink interface). As such, we recommend
+unmasking <c>sys-power/acpid-2.0.12</c> (or higher). For more information about
+unmasking packages, please read
+<uri link="/doc/en/handbook/handbook-amd64.xml?part=3&amp;chap=3">Mixing Software
+Branches</uri> in the Gentoo Handbook.
 </note>
 
-<pre caption="Creating a battery runlevel">
-# <i>cd /etc/runlevels</i>
-# <i>cp -a default battery</i>
+<pre caption="Installing laptop-mode-tools">
+# <i>emerge laptop-mode-tools</i>
 </pre>
 
-<p>
-Finished. Your new runlevel <c>battery</c> contains everything like
-<c>default</c>, but there is no automatic switch between both yet. Time to
-change it.
-</p>
-
 </body>
 </section>
 <section>
-<title>Reacting On ACPI Events</title>
+<title>Configuration</title>
 <body>
 
 <p>
-Typical ACPI events are closing the lid, changing the power source or pressing
-the sleep button. An important event is changing the power source, which should
-cause a runlevel switch. A small script will take care of it.
-</p>
-
-<p>
-First you need a script which changes the runlevel to <c>default</c>
-respectively <c>battery</c> depending on the power source. The script uses the
-<c>on_ac_power</c> command from <c>sys-power/pm-utils</c> - make sure the
-package is installed on your system.
+Having <c>laptop-mode-tools</c> 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 <path>/etc/laptop-mode/laptop-mode.conf</path>.
+This is the main configuration file for the package and is pretty well described
+(through comments).
 </p>
 
-<pre caption="Installing pm-utils">
-# <i>emerge pm-utils</i>
-</pre>
-
-<p>
-You are now able to determine the power source by executing <c>on_ac_power
-&amp;&amp; echo AC available || echo Running on batteries</c> in a shell. The
-script below is responsible for changing runlevels. Save it as
-<path>/etc/acpi/actions/pmg_switch_runlevel.sh</path>.
-</p>
-
-<pre caption="/etc/acpi/actions/pmg_switch_runlevel.sh">
-#!/bin/bash
-
-# BEGIN configuration
-RUNLEVEL_AC="default"
-RUNLEVEL_BATTERY="battery"
-
-if [ -x /usr/bin/logger ]; then
-    LOGGER="/usr/bin/logger -s -p daemon.info -t /etc/acpi/actions/pmg_switch_runlevel.sh"
-else
-    LOGGER="/bin/echo"
-fi
-
-ON_AC_POWER=/usr/bin/on_ac_power
-# END configuration
-
-
-if [ ! -d "/etc/runlevels/${RUNLEVEL_AC}" ]
-then
-    ${LOGGER} "${0}: Runlevel ${RUNLEVEL_AC} does not exist. Aborting."
-    exit 1
-fi
-
-if [ ! -d "/etc/runlevels/${RUNLEVEL_BATTERY}" ]
-then
-    ${LOGGER} "${0}: Runlevel ${RUNLEVEL_BATTERY} does not exist. Aborting."
-    exit 1
-fi
-
-if ${on_ac_power}
-then
-    if [[ "$(rc-status --runlevel)" != "${RUNLEVEL_AC}" ]]
-    then
-        ${LOGGER} "Switching to ${RUNLEVEL_AC} runlevel"
-        /sbin/rc ${RUNLEVEL_AC}
-    fi
-elif [[ "$(rc-status --runlevel)" != "${RUNLEVEL_BATTERY}" ]]
-then
-    ${LOGGER} "Switching to ${RUNLEVEL_BATTERY} runlevel"
-    /sbin/rc ${RUNLEVEL_BATTERY}
-fi
-</pre>
-
 <p>
-Dont forget to run <c>chmod +x /etc/acpi/actions/pmg_switch_runlevel.sh</c> to
-make the script executable. The last thing that needs to be done is calling the
-script whenever the power source changes. That's done by catching ACPI events
-with the help of <c>acpid</c>. First you need to know which events are
-generated when the power source changes. The events are called
-<c>ac_adapter</c> and <c>battery</c> on most laptops, but it might be different
-on yours.
+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 <path>/etc/laptop-mode/conf.d</path> and are
+named after the module they represent (such as
+<path>intel-sata-powermgmt.conf</path>).
 </p>
 
-<pre caption="Determining ACPI events for changing the power source">
-# <i>tail -f /var/log/messages | grep "ACPI event"</i>
-</pre>
-
 <p>
-Run the command above and pull the power cable. You should see something like
-this:
+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 <c>laptop-mode-tools</c> with other services like
+<c>cpufreqd</c>. In this example case, you will need to set
+<c>CONTROL_CPU_FREQUENCY=0</c>:
 </p>
 
-<pre caption="Sample output for power source changes">
-[Tue Sep 20 17:39:06 2005] ACPI event "ac_adapter AC 00000080 00000000"
-[Tue Sep 20 17:39:06 2005] ACPI event "battery BAT0 00000080 00000001"
+<pre caption="Editing /etc/laptop-mode/conf.d/cpufreq.conf">
+# <i>nano -w /etc/laptop-mode/conf.d/cpufreq.conf</i>
+CONTROL_CPU_FREQUENCY=<i>0</i>
 </pre>
 
 <p>
-The interesting part is the quoted string after <c>ACPI event</c>. It will
-be matched by the event line in the files you are going to create below. Don't
-worry if your system generates multiple events or always the same. As long as
-any event is generated, runlevel changing will work.
+The next few sections will help you configure <c>laptop-mode-tools</c> to suit
+your needs. When you are finished, start the <c>laptop_mode</c> service and make
+sure it is started when you boot up your system.
 </p>
 
-<pre caption="/etc/acpi/events/pmg_ac_adapter">
-<comment># replace "ac_adapter" below with the event generated on your laptop</comment>
-<comment># For example, ac_adapter.* will match ac_adapter AC 00000080 00000000</comment>
-event=ac_adapter.*
-action=/etc/acpi/actions/pmg_switch_runlevel.sh %e
+<pre caption="Starting the laptop_mode service">
+# <i>/etc/init.d/laptop_mode start</i>
+# <i>rc-update add laptop_mode default</i>
 </pre>
 
-<pre caption="/etc/acpi/events/pmg_battery">
-<comment># replace "battery" below with the event generated on your laptop</comment>
-<comment># For example, battery.* will match battery BAT0 00000080 00000001</comment>
-event=battery.*
-action=/etc/acpi/actions/pmg_switch_runlevel.sh %e
-</pre>
+</body>
+</section>
+<section>
+<title>How does laptop-mode-tools work</title>
+<body>
 
 <p>
-Finally acpid has to be restarted to recognize the changes.
+When running the <c>laptop_mode</c> service, the software will check in which
+state your system is in. The states are defined as:
 </p>
 
-<pre caption="Finishing runlevel switching with acpid">
-# <i>/etc/init.d/acpid restart</i>
-</pre>
+<ul>
+  <li>
+    <e>Battery</e>, in the configuration files using the <c>BATT_</c> prefix, is
+    active when the system is running on battery power
+  </li>
+  <li>
+    <e>AC</e>, in the configuration files using the <c>AC_</c> prefix, is active
+    when the system is running on AC power
+  </li>
+  <li>
+    <e>Laptop Mode</e>, in the configuration files using the <c>LM_</c> prefix,
+    is active when <e>laptop mode</e> is enabled
+  </li>
+  <li>
+    <e>No Laptop Mode</e>, in the configuration files using the <c>NOLM_</c>
+    prefix, is active when <e>laptop mode</e> is disabled
+  </li>
+</ul>
 
 <p>
-Give it a try: Plug AC in and out and watch syslog for the "Switching to AC
-mode" or "Switching to battery mode" messages. See the <uri
-link="#doc_chap8">Troubleshooting section</uri> if the script is not able to
-detect the power source correctly.
+The <c>AC/BATT_</c> and <c>LM/NOLM_</c> prefixes can be combined (so you can
+have a <c>AC_LM_</c> prefix).
 </p>
 
 <p>
-Due to the nature of the event mechanism, your laptop will boot into runlevel
-<c>default</c> regardless of the AC/battery state. This is fine when running
-from AC, but we'd like to boot into the battery runlevel otherwise. One
-solution would be to add another entry to the boot loader with the parameter
-<c>softlevel=battery</c>, but it's likely to forget choosing it. A better way
-is faking an ACPI event in the end of the boot process and letting
-<path>pmg_switch_runlevel.sh</path> script decide whether a runlevel change is
-necessary. Create a <path>/etc/local.d/battery.start</path> file with the
-following contents:
-</p>
-
-<pre caption="Runlevel adjustment at boot time through local.d/battery.start">
-#!/bin/sh
-<comment># Fake acpi event to switch runlevel if running on batteries</comment>
-/etc/acpi/actions/pmg_switch_runlevel.sh "battery/battery"
-</pre>
+When the <c>laptop_mode</c> service is started, it will switch modes based on
+events that occur (and of course based on the configuration settings). For
+instance, the setting <c>ENABLE_LAPTOP_MODE_ON_BATTERY=1</c> will make sure that
+the laptop mode tools switch to <e>laptop mode</e> when battery power is used.
+If that is the case, then the settings starting with <c>LM_</c>,
+<c>LM_BATT_</c>, <c>BATT_LM_</c> and <c>BATT_</c> will be used.
+</p>
 
 <p>
-Don't forget to mark the file as executable (<c>chmod +x
-/etc/local.d/battery.start</c>). Prepared like this you can activate Power
-Management policies for individual devices.
+To make sure settings to not collide, it is not allowed to have overlapping
+settigns. In the next example, the first set (for <c>CPU_MAXFREQ</c>) is valid,
+but the second one (for <c>CPU_GOVERNOR</c>) isn't.
 </p>
 
-</body>
-</section>
-</chapter>
-
-<chapter>
-<title>CPU Power Management</title>
-<section>
-<body>
+<pre caption="Colliding settings">
+<comment>## Valid set</comment>
+BATT_CPU_MAXFREQ=fastest
+LM_AC_CPU_MAXFREQ=fastest
+NOLM_AC_CPU_MAXFREQ=fastest
 
-<p>
-Mobile processors can operate at different frequencies. Some allow changing
-voltage as well. Most of the time your CPU doesn't need to run at full speed
-and scaling it down will save much energy - often without any performance
-decrease.
-</p>
+<comment>## Invalid set</comment>
+BATT_CPU_MINFREQ=fastest
+LM_AC_CPU_MINFREQ=fastest
+<comment># The following includes AC and BATT, but BATT is already defined</comment>
+NOLM_CPU_MINFREQ=fastest
+</pre>
 
 </body>
 </section>
 <section>
-<title>Some Technical Terms</title>
+<title>Configuring CPU frequency management</title>
 <body>
 
 <p>
-CPU frequency scaling brings up some technical terms that might be unknown to
-you. Here's a quick introduction.
+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
+<path>/etc/laptop-mode/conf.d/cpufreq.conf</path>.
 </p>
 
 <p>
-First of all, the kernel has to be able to change the processor's frequency.
-The <b>CPUfreq processor driver</b> knows the commands to do it on your CPU.
-Thus it's important to choose the right one in your kernel. You should already
-have done it above. Once the kernel knows how to change frequencies, it has to
-know which frequency it should set. This is done according to the <b>policy</b>
-which consists of a <b>CPUfreq policy</b> and a <b>governor</b>. A CPUfreq
-policy are just two numbers which define a range the frequency has to stay
-between - minimal and maximal frequency. The governor now decides which of the
-available frequencies in between minimal and maximal frequency to choose. For
-example, the <b>powersave governor</b> always chooses the lowest frequency
-available, the <b>performance governor</b> the highest one. The <b>userspace
-governor</b> makes no decision but chooses whatever the user (or a program in
-userspace) wants - which means it reads the frequency from
-<path>/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed</path>.
+The <e>CPU frequency governor</e> 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:
 </p>
 
+<ul>
+  <li>
+    <c>performance</c> always picks the highest frequency
+  </li>
+  <li>
+    <c>powersave</c> always picks the lowest frequency
+  </li>
+  <li>
+    <c>userspace</c> does not pick anything, but let the user decide (or any
+    process that the user is running that will decide for the user)
+  </li>
+  <li>
+    <c>ondemand</c> will scale the CPU frequency up to the highest frequency
+    when load is available
+  </li>
+  <li>
+    <c>conservative</c> will scale the CPU frequency up gradually when load is
+    available
+  </li>
+</ul>
+
 <p>
-This doesn't sound like dynamic frequency changes yet and in fact it isn't.
-Dynamics however can be accomplished with various approaches. For example, the
-<b>ondemand governor</b> makes its decisions depending on the current CPU load.
-The same is done by various userland tools like <c>cpudyn</c>, <c>cpufreqd</c>,
-<c>powernowd</c> and many more. ACPI events can be used to enable or disable
-dynamic frequency changes depending on power source.
+When switching between AC or battery, or (no) laptop mode, the appropriate
+governor (as well as its minimum and maximum frequency) is selected.
 </p>
 
 </body>
 </section>
 <section>
-<title>Setting The Frequency</title>
+<title>Configuring display brightness</title>
 <body>
 
 <p>
-Decreasing CPU speed and voltage has two advantages: On the one hand less
-energy is consumed, on the other hand there is thermal improvement as your
-system doesn't get as hot as running on full speed. The main disadvantage is
-obviously the loss of performance. Decreasing processor speed is a trade off
-between performance loss and energy saving.
+With <path>/etc/laptop-mode/conf.d/lcd-brightness.conf</path>, you can have the
+laptop mode tools govern the brightness of your LCD screen. 
 </p>
 
-<note>
-Not every laptop supports frequency scaling. If unsure, have a look at the list
-of supported processors in the <uri link="#doc_chap8">Troubleshooting</uri>
-section to verify yours is supported.
-</note>
-
 <p>
-It's time to test whether CPU frequency changing works. Let's install another
-tool: <c>sys-power/cpufrequtils</c>.
+The file currently uses the <path>/proc/acpi/video/VID/LCD/brightness</path>
+file to set brightness values. Recent kernels do not provide this anymore -
+you will need to adjust this to <path>/sys/class/backlight/acpi_video0/brightness</path>
+instead.
 </p>
 
-<pre caption="Checking CPU frequency">
-# <i>emerge cpufrequtils</i>
-# <i>cpufreq-info</i>
-</pre>
-
 <p>
-Here is an example output:
+The values you can use are between 0 and 15, with 0 being the lowest brightness
+value.
 </p>
 
-<pre caption="Sample output from cpufreq-info">
-cpufrequtils 0.3: cpufreq-info (C) Dominik Brodowski 2004
-Report errors and bugs to linux@..., please.
-analyzing CPU 0:
-  driver: centrino
-  CPUs which need to switch frequency at the same time: 0
-  hardware limits: 600 MHz - 1.40 GHz
-  available frequency steps: 600 MHz, 800 MHz, 1000 MHz, 1.20 GHz, 1.40 GHz
-  available cpufreq governors: conservative, ondemand, powersave, userspace, performance
-  current policy: frequency should be within 924 MHz and 1.40 GHz.
-    The governor "performance" may decide which speed to use
-    within this range.
-  current CPU frequency is 1.40 GHz.
-</pre>
+</body>
+</section>
+<section>
+<title>Configuring other services</title>
+<body>
 
 <p>
-Now play around with <c>cpufreq-set</c> to make sure frequency switching works.
-Run <c>cpufreq-set -g ondemand</c> for example to activate the ondemand
-governor and verify the change with <c>cpufreq-info</c>. If it doesn't work as
-expected, you might find help in the <uri link="#doc_chap8">Troubleshooting
-section</uri> in the end of this guide.
+An interesting feature of <c>laptop-mode-tools</c> is to support reloading
+particular services (like the system logger) after switching its configuration
+file. This is handled through
+<path>/etc/laptop-mode/conf.d/configuration-file-control.conf</path>.
 </p>
 
 <p>
-<c>cpufrequtils</c> can operate in an automatic mode (when you use the
-<b>ondemand</b> governor), you can also switch to the <b>userspace</b> governor
-if you want to manually set a specific speed. You can also statically set your
-CPU to its highest or lowest frequency by using the <b>performance</b>
-and <b>powersave</b> governors, respectively.
-</p>
-
-<pre caption="Changing CPU speeds">
-<comment>(Set the highest available frequency)</comment>
-# <i>cpufreq-set -g performance</i>
-<comment>(Set the lowest available frequency)</comment>
-# <i>cpufreq-set -g powersave</i>
-<comment>(Set a specific frequency)</comment>
-# <i>cpufreq-set -g userspace</i>
-# <i>cpufreq-set -f 2.00ghz</i>
-</pre>
+If enabled, the <c>laptop_mode</c> application will switch the configuration
+file(s) of the mentioned services with the same file, but suffixed with
+<path>-nolm-ac</path>, <path>-lm-ac</path> or <path>-batt</path>. It willl then
+signal or reload the appropriate services so they can use the new configuration
+file.
+</p>
 
 </body>
 </section>
+</chapter>
+
+<chapter>
+<title>Using cpufreqd</title>
 <section>
-<title>Other CPU Speed Utilities</title>
+<title>Installation</title>
 <body>
 
 <p>
-While <c>cpufrequtils</c> may be the best all-around program, there are some
-other choices available in Portage. The following table gives a quick overview
-of available CPU speed utilities. It's roughly separated in three categories
-<b>kernel</b> for approaches that only need kernel support, <b>daemon</b> for
-programs that run in the background and <b>graphical</b> for programs that
-provide a GUI for easy configuration and changes.
+The <c>cpufreqd</c> application allows you to manage CPU frequencies in a more
+granular approach then what <c>laptop-mode-tools</c> supports. But before we
+dive into the installation of <c>cpufreqd</c>, let's first look at the USE flags
+it supports.
 </p>
 
 <table>
 <tr>
-  <th>Name</th>
-  <th>Category</th>
-  <th>Switch decision</th>
-  <th>Kernel governors</th>
-  <th>Further governors</th>
-  <th>Comments</th>
+  <th>USE flag</th>
+  <th>Description</th>
+  <th>Suggested when...</th>
 </tr>
 <tr>
-  <ti>'ondemand' governor</ti>
-  <ti>Kernel</ti>
-  <ti>CPU load</ti>
-  <ti>N.A.</ti>
-  <ti>N.A.</ti>
+  <ti>acpi</ti>
   <ti>
-    Chooses maximal frequency on CPU load and slowly steps down when the CPU is
-    idle. Further tuning through files in
-    <path>/sys/devices/system/cpu/cpu0/cpufreq/ondemand/</path>. Still requires
-    userland tools (programs, scripts) if governor switching or similar is
-    desired.
+    Enable support for ACPI, allowing <c>cpufreqd</c> to be notified about
+    specific events as well as govern power through the ACPI interface
   </ti>
+  <ti>your laptop is not too old (~ year 2003 and later)</ti>
 </tr>
 <tr>
-  <ti>'conservative' governor</ti>
-  <ti>Kernel</ti>
-  <ti>CPU load</ti>
-  <ti>N.A.</ti>
-  <ti>N.A.</ti>
+  <ti>apm</ti>
   <ti>
-    Unlike the ondemand governor, conversative doesn't jump to maximum
-    frequency when CPU load is high, but increases the frequency step by step.
-    Further tuning through files in
-    <path>/sys/devices/system/cpu/cpu0/cpufreq/ondemand/</path>. Still requires
-    userland tools (programs, scripts) if governor switching or similar is
-    desired.
+    Enable support for APM, allowing <c>cpufreqd</c> to be notified about
+    specific events as wel as govern power through the APM interface
   </ti>
+  <ti>your laptop is very old</ti>
 </tr>
 <tr>
-  <ti><uri link="http://mnm.uib.es/~gallir/cpudyn/">cpudyn</uri></ti>
-  <ti>Daemon</ti>
-  <ti>CPU load</ti>
-  <ti>Performance, powersave</ti>
-  <ti>Dynamic</ti>
+  <ti>lm_sensors</ti>
   <ti>
-    Also supports disk standby - notice however that <e>laptop mode</e> in most
-    cases will do a better job.
+    Enable support for the Linux hardware sensors (through
+    <c>sys-apps/lm_sensors</c>), allowing to switch profiles based on hardware
+    sensor results
   </ti>
-</tr>
-<tr>
-  <ti><uri link="http://sourceforge.net/projects/cpufreqd/">cpufreqd</uri></ti>
-  <ti>Daemon</ti>
-  <ti>Battery state, CPU load, temperature, running programs and more</ti>
-  <ti>All available</ti>
-  <ti>None</ti>
   <ti>
-    Sophisticated (but somewhat complicated) setup. Extendible through plugins
-    like sensor monitoring (lm_sensors) or coordinating some NVidia based
-    graphics card memory and core. Cpufreqd is SMP aware and can optionally be
-    controlled manually at runtime.
+    you want to use advanced events through lm_sensors
   </ti>
 </tr>
 <tr>
+  <ti>nforce2</ti>
   <ti>
-    <uri link="http://www.deater.net/john/powernowd.html">powernowd</uri>
+    Enable support for NForce, allowing <c>cpufreqd</c> to change the NForce FSB
+    clock and video card frequency
   </ti>
-  <ti>Daemon</ti>
-  <ti>CPU load</ti>
-  <ti>None</ti>
-  <ti>Passive, sine, aggressive</ti>
   <ti>
-    Supports SMP.
+    you have an NVidia graphical card based on the NForce chipset
   </ti>
 </tr>
 <tr>
+  <ti>nvidia</ti>
   <ti>
-    <uri
-    link="http://projects.simpledesigns.com.pl/project/ncpufreqd/">ncpufreqd</uri>
-  </ti>
-  <ti>Daemon</ti>
-  <ti>Temperature</ti>
-  <ti>None</ti>
-  <ti>Powersave, performance</ti>
-  <ti>
-    Toggles the used governor between performance and powersave depending on
-    system temperature. Very useful on laptops with notorious heat problems.
+    Enable support for NVidia graphical card configuration (through the NVidia
+    <e>nvclock</e> interface), allowing <c>cpufreqd</c> to change the video card
+    frequency of NVidia graphical cards
   </ti>
-</tr>
-<tr>
-  <ti><uri link="http://www.goop.org/~jeremy/speedfreq/">speedfreq</uri></ti>
-  <ti>Daemon</ti>
-  <ti>CPU load</ti>
-  <ti>None</ti>
-  <ti>Dynamic, powersave, performance, fixed speed</ti>
   <ti>
-    Easy to configure with a nice client/server interface. Requires a 2.6
-    kernel. Unmaintained, broken and thus removed from Portage. Please switch
-    to cpufreqd if you're still using it.
+    you have an NVidia graphical card
   </ti>
 </tr>
 <tr>
-  <ti><uri link="http://cpuspeedy.sourceforge.net/">gtk-cpuspeedy</uri></ti>
-  <ti>Graphical</ti>
-  <ti>None</ti>
-  <ti>None</ti>
-  <ti>None</ti>
+  <ti>pmu</ti>
   <ti>
-    Gnome application, a graphical tool to set CPU frequency manually. It does
-    not offer any automation.
+    Enable the Power Management Unit plug-in of <c>cpufreqd</c>. This allows the
+    software to poll the Linux kernel Power Supply interface, getting more
+    detailed information on battery charge.
   </ti>
-</tr>
-<tr>
-  <ti>klaptopdaemon</ti>
-  <ti>Graphical</ti>
-  <ti>Battery state</ti>
-  <ti>All available</ti>
-  <ti>None</ti>
   <ti>
-    KDE only, 'ondemand' governor required for dynamic frequency scaling.
+    your laptop does not support ACPI or APM
   </ti>
 </tr>
 </table>
 
 <p>
-While adjusting the frequency to the current load looks simple at a first
-glance, it's not such a trivial task. A bad algorithm can cause switching
-between two frequencies all the time or wasting energy when setting frequency
-to an unnecessary high level.
+The USE flags <c>acpi</c>, <c>apm</c> and <c>pmu</c> overlap, so you should only
+have one active. If your laptop is sufficiently recent, <c>acpi</c> is your best
+bet. If not, <c>apm</c> offers all that is needed. When even APM isn't
+supported, you can try <c>pmu</c>.
 </p>
 
 <p>
-Which one to choose? If you have no idea about it, try <c>cpufreqd</c>:
+With the USE flags configured, it is time to install <c>cpufreqd</c>.
 </p>
 
 <pre caption="Installing cpufreqd">
 # <i>emerge cpufreqd</i>
 </pre>
 
-<p>
-<c>cpufreqd</c> can be configured by editing <path>/etc/cpufreqd.conf</path>.
-The default one that ships with cpufreqd may look a bit confusing. I recommend
-replacing it with the one from former Gentoo developer Henrik Brix Andersen
-(see below). Please notice that you need cpufreqd-2.0.0 or later. Earlier
-versions have a different syntax for the config file.
-</p>
-
-<pre caption="/etc/cpufreqd.conf (cpufreqd-2.0.0 and later)">
-[General]
-pidfile=/var/run/cpufreqd.pid
-poll_interval=3
-enable_plugins=acpi_ac, acpi_battery
-enable_remote=1
-remote_group=wheel
-verbosity=5
-[/General]
-
-[Profile]
-name=ondemand
-minfreq=0%
-maxfreq=100%
-policy=ondemand
-[/Profile]
-
-[Profile]
-name=conservative
-minfreq=0%
-maxfreq=100%
-policy=conservative
-[/Profile]
-
-[Profile]
-name=powersave
-minfreq=0%
-maxfreq=100%
-policy=powersave
-[/Profile]
-
-[Profile]
-name=performance
-minfreq=0%
-maxfreq=100%
-policy=performance
-[/Profile]
-
-[Rule]
-name=battery
-ac=off
-profile=conservative
-[/Rule]
-
-[Rule]
-name=battery_low
-ac=off
-battery_interval=0-10
-profile=powersave
-[/Rule]
-
-[Rule]
-name=ac
-ac=on
-profile=ondemand
-[/Rule]
-</pre>
-
-<p>
-Now you can start the cpufreqd daemon. Add it to the <c>default</c> and
-<c>battery</c> runlevel as well.
-</p>
-
-<pre caption="Starting cpufreqd">
-# <i>rc-update add cpufreqd default battery</i>
-# <i>/etc/init.d/cpufreqd start</i>
-</pre>
-
-<p>
-Sometimes it can be desirable to select another policy than the daemon chooses,
-for example when battery power is low, but you know that AC will be available
-soon. In that case you can turn on cpufreqd's manual mode with <c>cpufreqd-set
-manual</c> and select one of your configured policies (as listed by
-<c>cpufreqd-get</c>). You can leave manual mode by executing <c>cpufreqd-set
-dynamic</c>.
-</p>
-
-<warn>
-Do not run more than one of the above programs at the same time. It may cause
-confusion like switching between two frequencies all the time.
-</warn>
-
 </body>
 </section>
 <section>
-<title>Verifying the result</title>
+<title>Configuration</title>
 <body>
 
 <p>
-The last thing to check is that your new policies do a good job. An easy way to
-do so is monitoring CPU speed while working with your laptop:
-</p>
-
-<pre caption="Monitoring CPU speed">
-# <i>watch grep \"cpu MHz\" /proc/cpuinfo</i>
-</pre>
-
-<p>
-If <path>/proc/cpuinfo</path> doesn't get updated (see <uri
-link="#doc_chap8">Troubleshooting</uri>), monitor the CPU frequency with
-<c>sys-apps/x86info</c>:
+The <c>cpufreqd</c> 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.
 </p>
 
-<pre caption="Alternative CPU speed monitoring">
-# <i>watch x86info -mhz</i>
-</pre>
-
 <p>
-Depending on your setup, CPU speed should increase on heavy load, decrease on
-no activity or just stay at the same level. When using <c>cpufreqd</c> and
-verbosity set to 5 or higher in <path>cpufreqd.conf</path> you'll get
-additional information about what's happening reported to <c>syslog</c>.
+<c>cpufreqd</c> can be configured by editing <path>/etc/cpufreqd.conf</path>. It
+contains three different sections:
 </p>
 
-</body>
-</section>
-</chapter>
-
-<chapter>
-<title>LCD Power Management</title>
-<section>
-<body>
+<ol>
+  <li>
+    The <c>[General]...[/General]</c> section contains general configuration
+    information
+  </li>
+  <li>
+    The <c>[Profile]...[/Profile]</c> section defines the policies that the
+    <c>cpufreqd</c> daemon can switch to. The section is very similar to the
+    information you use when manually setting the CPU frequency policy using
+    <c>cpufreq-set</c>.
+  </li>
+  <li>
+    The <c>[Rule]...[/Rule]</c> section is the work-horse of the <c>cpufreqd</c>
+    daemon, defining when the daemon decides to switch to a different profile.
+  </li>
+</ol>
 
 <p>
-As you can see in <uri link="#doc_chap1_fig1">figure 1.1</uri>, the LCD
-display consumes the biggest part of energy (might not be the case for
-non-mobile CPU's). Thus it's quite important not only to shut the display off
-when not needed, but also to reduce it's backlight if possible. Most laptops
-offer the possibility to control the backlight dimming.
+Let's take a quick look at an example rule.
 </p>
 
-</body>
-</section>
-<section>
-<title>Standby settings</title>
-<body>
+<pre caption="Sample cpufreqd rule">
+[Profile]
+name=On Demand High
+minfreq=40%
+maxfreq=100%
+policy=ondemand
+[/Profile]
 
-<p>
-The first thing to check is the standby/suspend/off timings of the display. As
-this depends heavily on your windowmanager, I'll let you figure it out
-yourself. Just two common places: Blanking the terminal can be done with
-<c>setterm -blank &lt;number-of-minutesM&gt;</c>, <c>setterm -powersave on</c>
-and <c>setterm -powerdown &lt;number-of-minutesM&gt;</c>.  For X.org, modify
-<path>/etc/X11/xorg.conf</path> similar to this:
-</p>
-
-<pre caption="LCD suspend settings in X.org">
-Section "ServerFlags"
-  Option  "blank time"  "5"  <comment># Blank the screen after 5 minutes (Fake)</comment>
-  Option  "standby time"  "10"  <comment># Turn off screen after 10 minutes (DPMS)</comment>
-  Option  "suspend time"  "20"  <comment># Full suspend after 20 minutes</comment>
-  Option  "off time"  "30"  <comment># Turn off after half an hour</comment>
-  [...]
-EndSection
-
-[...]
-
-Section "Monitor"
-  Identifier  [...]
-  Option  "DPMS"
-  [...]
-EndSection
+[Rule]
+name=AC Off - High Power
+ac=off
+battery_interval=70-100
+profile=On Demand High
+[/Rule]
 </pre>
 
-</body>
-</section>
-<section>
-<title>Backlight dimming</title>
-<body>
-
 <p>
-Probably more important is the backlight dimming. If you have access to the
-dimming settings via a tool, write a small script that dims the backlight in
-battery mode and place it in your <c>battery</c> runlevel. The following script
-should work on most IBM Thinkpads and Toshiba laptops. You've got to enable the
-appropriate option in your kernel (IBM Thinkpads only). For Toshiba laptops,
-install <c>sys-power/acpitool</c> and skip configuration of <c>thinkpad_acpi</c>
-(formerly called <c>ibm_acpi</c>) as described below.
-</p>
-
-<warn>
-Support for setting brightness is marked experimental in thinkpad_acpi. It
-accesses hardware directly and may cause severe harm to your system. Please
-read the <uri link="http://ibm-acpi.sourceforge.net/">thinkpad_acpi
-website</uri>
-</warn>
-
-<p>
-To be able to set the brightness level, the thinkpad_acpi module has to be
-loaded with the experimental parameter.
-</p>
-
-<pre caption="Automatically loading the thinkpad_acpi module">
-<comment>(Please read the warnings above before doing this!)</comment>
-
-# <i>echo "options thinkpad_acpi experimental=1" >> /etc/modprobe.d/thinkpad_acpi</i>
-# <i>update-modules</i>
-# <i>nano /etc/conf.d/modules</i>
-<comment># Autoload the thinkpad_acpi module</comment>
-modules_2_6="thinkpad_acpi"
-<comment># Parameters for the thinkpad_acpi module</comment>
-modules_thinkpad_acpi_args_2_6="experimental=1"
-
-# <i>modprobe thinkpad_acpi</i>
-</pre>
+In the above example, <c>cpufreqd</c> will switch the system to the <e>On Demand
+High</e> profile (also shown in the above excerpt). This profile by itself uses
+the <c>ondemand</c> governor with a minimum frequency of 40% (iow, a CPU of 2Ghz
+will have by this policy a minimum frequency of 800Mhz).
+</p>
 
 <p>
-This should work without error messages and a file
-<path>/proc/acpi/ibm/brightness</path> should be created after loading the
-module. An init script will take care of choosing the brightness according to
-the power source.
+As you can see, the <c>cpufreqd</c> 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.
 </p>
 
-<pre caption="/etc/conf.d/lcd-brightness">
-<comment># See /proc/acpi/ibm/brightness for available values</comment>
-<comment># Please read /usr/src/linux/Documentation/thinkpad-acpi.txt</comment>
-
-<comment># brightness level in ac mode. Default is 7.</comment>
-BRIGHTNESS_AC=7
-
-<comment># brightness level in battery mode. Default is 4.</comment>
-BRIGHTNESS_BATTERY=4
-</pre>
-
-<pre caption="/etc/init.d/lcd-brightness">
-#!/sbin/runscript
-
-set_brightness() {
-    if on_ac_power
-    then
-        LEVEL=${BRIGHTNESS_AC:-7}
-    else
-        LEVEL=${BRIGHTNESS_BATTERY:-4}
-    fi
-
-    if [ -f /proc/acpi/ibm/brightness ]
-    then
-        ebegin "Setting LCD brightness"
-        echo "level ${LEVEL}" > /proc/acpi/ibm/brightness
-        eend $?
-    elif [[ -e /usr/bin/acpitool &amp;&amp; -n $(acpitool -T | grep "LCD brightness") ]]
-    then
-        ebegin "Setting LCD brightness"
-        acpitool -l $LEVEL >/dev/null || ewarn "Unable to set lcd brightness"
-        eend $?
-    else
-        ewarn "Setting LCD brightness is not supported."
-        ewarn "For IBM Thinkpads, check that thinkpad_acpi is loaded into the kernel"
-        ewarn "For Toshiba laptops, you've got to install sys-power/acpitool"
-    fi
-}
-
-start() {
-    set_brightness
-}
-
-stop () {
-    set_brightness
-}
-</pre>
-
 <p>
-When done, make sure brightness is adjusted automatically by adding it to the
-battery runlevel.
+When you have configured <c>cpufreqd</c>, it is time to start it (and make sure
+the service is loaded automatically). Make sure that CPU frequency handling by
+other tools (like <c>laptop-mode-tools</c>) is disabled!
 </p>
 
-<pre caption="Enabling automatic brightness adjustment">
-# <i>chmod +x /etc/init.d/lcd-brightness</i>
-# <i>rc-update add lcd-brightness battery</i>
-# <i>rc</i>
+<pre caption="Starting cpufreqd">
+# <i>rc-service add cpufreqd default</i>
+# <i>/etc/init.d/cpufreqd start</i>
 </pre>
 
 </body>
@@ -993,722 +643,40 @@
 </chapter>
 
 <chapter>
-<title>Disk Power Management</title>
-<section>
-<body>
-
-<p>
-Hard disks consume less energy in sleep mode. Therefore it makes sense to
-activate power saving features whenever the hard disk is not used for a certain
-amount of time. I'll show you two alternative possibilities to do it. First,
-laptop-mode will save most energy due to several measures which prevent or at
-least delay write accesses. The drawback is that due to the delayed write
-accesses a power outage or kernel crash will be more dangerous for data loss.
-If you don't like this, you have to make sure that there are no processes which
-write to your hard disk frequently. Afterwards you can enable power saving
-features of your hard disk with <c>hdparm</c> as the second alternative.
-</p>
-
-</body>
-</section>
+<title>Resources</title>
 <section>
-<title>Increasing idle time - laptop-mode</title>
+<title>Tools</title>
 <body>
 
-<p>
-Recent 2.6 kernels include the so-called <c>laptop-mode</c>. When activated,
-dirty buffers are written to disk on read calls or after 10 minutes (instead of
-30 seconds). This minimizes the time the hard disk needs to be spun up.
-</p>
-
-<pre caption="Automated start of laptop-mode">
-# <i>emerge laptop-mode-tools</i>
-</pre>
-
-<p>
-<c>laptop-mode-tools</c> has its configuration file in
-<path>/etc/laptop-mode/laptop-mode.conf</path>. Adjust it the way you like it,
-it's well commented. Run <c>rc-update add laptop_mode battery</c> to start it
-automatically.
-</p>
-
-<p>
-Recent versions (1.11 and later) of laptop-mode-tools include a new tool
-<c>lm-profiler</c>. It will monitor your system's disk usage and running
-network services and suggests to disable unneeded ones. You can either disable
-them through laptop-mode-tools builtin runlevel support (which will be reverted
-by Gentoo's <c>/sbin/rc</c>) or use your <c>default</c>/<c>battery</c>
-runlevels (recommended).
-</p>
-
-<pre caption="Sample output from running lm-profiler">
-# <i>lm-profiler</i>
-Profiling session started.
-Time remaining: 600 seconds
-[4296896.602000] amarokapp
-Time remaining: 599 seconds
-[4296897.714000] sort
-[4296897.970000] mv
-Time remaining: 598 seconds
-Time remaining: 597 seconds
-[4296900.482000] reiserfs/0
-</pre>
-
-<p>
-After profiling your system for ten minutes, lm-profiler will present a list of
-services which might have caused disk accesses during that time.
-</p>
-
-<pre caption="lm-profiler suggests to disable some services">
-Program:     "atd"
-Reason:      standard recommendation (program may not be running)
-Init script: /etc/init.d/atd (GUESSED)
-
-Do you want to disable this service in battery mode? [y/N]: <i>n</i>
-</pre>
-
-<p>
-To disable atd as suggested in the example above, you would run <c>rc-update
-del atd battery</c>. Be careful not to disable services that are needed for
-your system to run properly - <c>lm-profiler</c> is likely to generate some
-false positives. Do not disable a service if you are unsure whether it's
-needed.
-</p>
+<ul>
+  <li>
+    <uri link="http://samwel.tk/laptop_mode/">Laptop Mode Tools Homepage</uri>,
+    includes <uri link="http://samwel.tk/laptop_mode/laptop_mode">About laptop
+    mode</uri>.
+  </li>
+  <li>
+    <uri link="http://www.lesswatts.org/projects/powertop/">PowerTOP</uri>, an
+    interactive application helping users to find out which processes are
+    forcing wakeups on the CPU most often.
+  </li>
+</ul>
 
 </body>
 </section>
 <section>
-<title>Limiting Write Accesses</title>
+<title>Articles and Guides</title>
 <body>
 
-<p>
-If you don't want to use laptop-mode, you must take special care to disable
-services that write to your disk frequently - <c>syslogd</c> is a good
-candidate, for example. You probably don't want to shut it down completely, but
-it's possible to modify the config file so that "unnecessary" things don't get
-logged and thus don't create disk traffic. <c>Cups</c> writes to disk
-periodically, so consider shutting it down and only enable it manually when
-needed.
-</p>
-
-<pre caption="Disabling cups in battery mode">
-# <i>rc-update del cupsd battery</i>
-</pre>
-
-<p>
-You can also use <c>lm-profiler</c> from laptop-mode-tools (see above) to find
-services to disable. Once you eliminated all of them, go on with configuring
-hdparm.
-</p>
-
-</body>
-</section>
-<section>
-<title>hdparm</title>
-<body>
-
-<p>
-The second possibility is using <c>hdparm</c>. Skip this if
-you are using laptop-mode. Otherwise, edit <path>/etc/conf.d/hdparm</path> and
-add the following values to your drive entries. This example assumes your hard
-drive is called <b>hda</b>:
-</p>
-
-<pre caption="Using /etc/conf.d/hdparm for disk standby">
-hda_args="-q -S12"
-</pre>
-
-<p>
-This will activate power management for your hard drive. If you ever want to
-deactivate power management, you can edit <path>/etc/conf.d/hdparm</path> and
-change the values to <c>-q -S0</c>, or just run <c>hdparm -q -S0 /dev/hda</c>.
-</p>
-
-<p>
-See <c>man hdparm</c> for the options. Though you can always start <c>hdparm</c>
-manually when you are on battery power by running <c>/etc/init.d/hdparm
-start</c>, it's much easier to automate its startup and shutdown. To do so, add
-<c>hdparm</c> to the battery runlevel so that it will automatically enable power
-management.
-</p>
-
-<pre caption="Automate disk standby settings">
-# <i>rc-update add hdparm battery</i>
-</pre>
-
-<impo>
-Be careful with sleep/spin down settings of your hard drive. Setting it to
-small values might wear out your drive and lose warranty.
-</impo>
-
-</body>
-</section>
-<section>
-<title>Other tricks</title>
-<body>
-
-<p>
-Another possibility is to deactivate swap in battery mode. Before writing a
-swapon/swapoff switcher, make sure there is enough RAM and swap isn't used
-heavily, otherwise you'll be in big problems.
-</p>
-
-<p>
-If you don't want to use laptop-mode, it's still possible to minimize disk
-access by mounting certain directories as <c>tmpfs</c> - write accesses are not
-stored on a disk, but in main memory and get lost with unmounting. Often it's
-useful to mount <path>/tmp</path> like this - you don't have to pay special
-attention as it gets cleared on every reboot regardless whether it was mounted
-on disk or in RAM. Just make sure you have enough RAM and no program (like a
-download client or compress utility) needs extraordinary much space in
-<path>/tmp</path>. To activate this, enable tmpfs support in your kernel and
-add a line to <path>/etc/fstab</path> like this:
-</p>
-
-<pre caption="Editing /etc/fstab to make /tmp even more volatile">
-none  /tmp  tmpfs  size=32m  0 0
-</pre>
-
-<warn>
-Pay attention to the size parameter and modify it for your system. If you're
-unsure, don't try this at all, it can become a performance bottleneck easily. In
-case you want to mount <path>/var/log</path> like this, make sure to merge the
-log files to disk before unmounting. They are essential. Don't attempt to mount
-<path>/var/tmp</path> like this. Portage uses it for compiling...
-</warn>
-
-</body>
-</section>
-</chapter>
-
-<chapter>
-<title>Power Management For Other Devices</title>
-<section>
-<title>Graphics Cards</title>
-<body>
-
-<p>
-In case you own an ATI graphics card supporting PowerPlay (dynamic clock
-scaling for the graphics processing unit GPU), you can activate this
-feature in X.org. Open <path>/etc/X11/xorg.conf</path> and add (or enable) the
-<c>DynamicClocks</c> option in the Device section. Please notice that this
-feature will lead to crashes on some systems.
-</p>
-
-<pre caption="Enabling ATI PowerPlay support in X.org">
-Section "Device"
-[...]
-Option      "DynamicClocks" "on"
-EndSection
-</pre>
-
-</body>
-</section>
-<section>
-<title>Wireless Power Management</title>
-<body>
-
-<p>
-Wireless LAN cards consume quite a bit of energy. Put them in Power Management
-mode just like your hard drives.
-</p>
-
-<note>
-This script assumes your wireless interface is called <c>wlan0</c>; replace
-this with the actual name of your interface.
-</note>
-
-<p>
-Add the following option to <path>/etc/conf.d/net</path> to automatically enable
-power management for your wireless card:
-</p>
-
-<pre caption="Automated WLAN Power Management">
-iwconfig_wlan0="power on"
-</pre>
-
-<p>
-See <c>man iwconfig</c> for details and more options like the period between
-wakeups or timeout settings. If your driver and access point support changing
-the beacon time, this is a good starting point to save even more energy.
-</p>
-
-</body>
-</section>
-<section>
-<title>USB Power Management</title>
-<body>
-
-<p>
-There are two problems with USB devices regarding energy consumption: First,
-devices like USB mice, digital cameras or USB sticks consume energy while
-plugged in. You cannot avoid this (nevertheless remove them in case they're not
-needed). Second, when there are USB devices plugged in, the USB host controller
-periodically accesses the bus which in turn prevents the CPU from going into
-sleep mode. The kernel offers an experimental option to enable suspension of
-USB devices through driver calls or one of the <path>power/state</path> files
-in <path>/sys</path>.
-</p>
-
-<pre caption="Enabling USB suspend support in the kernel">
-Device Drivers
-  USB support
-    [*]   Support for Host-side USB
-      [*]   USB suspend/resume (EXPERIMENTAL)
-</pre>
-
-</body>
-</section>
-</chapter>
-
-<chapter>
-<title>Sleep States: sleep, standby, and suspend to disk</title>
-<section>
-<body>
-
-<p>
-ACPI defines different sleep states. The more important ones are
-</p>
-
 <ul>
-  <li>S1 aka Standby</li>
-  <li>S3 aka Suspend to RAM aka Sleep</li>
-  <li>S4 aka Suspend to Disk aka Hibernate</li>
+  <li>
+    A ThinkWiki article on <uri
+    link="http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption">How to
+    reduce power consumption</uri> (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).
+  </li>
 </ul>
 
-<p>
-They can be called whenever the system is not in use, but a shutdown is not
-wanted due to the long boot time.
-</p>
-
-</body>
-</section>
-<section>
-<title>Sleep (S3)</title>
-<body>
-
-<p>
-The ACPI support for these sleep states is marked experimental for good reason.
-APM sleep states seem to be more stable, however you can't use APM and ACPI
-together.
-</p>
-
-<pre caption="Kernel configuration for the various suspend types">
-  Power Management Options ---&gt;
-    [*]  Power Management support
-    [*]  Suspend to RAM and standby 
-</pre>
-
-<p>
-Once your kernel is properly configured, you can use the
-<c>hibernate-script</c> to activate suspend or sleep mode. Let's install that
-first.
-</p>
-
-<pre caption="Installing the hibernate-script">
-# <i>emerge hibernate-script</i>
-</pre>
-
-<p>
-Some configuration has to be done in <path>/etc/hibernate</path>. The default
-package introduces a few configuration files for each sleep state.  Options that
-are common to all suspend methods are placed in <path>common.conf</path>; make
-sure this file is properly set up for your system.
-</p>
-
-<p>
-To configure sleep, edit <path>sysfs-ram.conf</path> in
-<path>/etc/hibernate</path>. <c>UseSysfsPowerState mem</c> is already setup
-correctly, but if you need to make further changes to this particular sleep
-state (or any other sleep state) you should add them to
-<path>/etc/hibernate/hibernate.conf</path>. The comments and option names will
-guide you. If you use nfs or samba shares over the network, make sure to
-shutdown the appropriate init scripts to avoid timeouts.
-</p>
-
-<note>
-For more information on setting up sleep states, read <c>man
-hibernate.conf</c>.
-</note>
-
-<p>
-Ready? Now is the last chance to backup any data you want to keep after
-executing the next command. Notice that you probably have to hit a special key
-like <c>Fn</c> to resume from sleep.
-</p>
-
-<pre caption="Calling sleep">
-# <i>hibernate-ram</i>
-</pre>
-
-<p>
-If you're still reading, it seems to work. You can also setup standby (S1) in a
-similar way by editing <path>sysfs-ram.conf</path> and changing
-"UseSysfsPowerState mem" to "UseSysfsPowerState standby". S3 and S4 are the more
-interesting sleep states due to greater energy savings however.
-</p>
-
-</body>
-</section>
-<section>
-<title>Hibernate (S4)</title>
-<body>
-
-<p>
-This section introduces hibernation, where a snapshot of the running system is
-written to disk before powering off. On resume, the snapshot is loaded and you
-can go on working at exactly the point you called hibernate before.
-</p>
-
-<warn>
-Don't exchange non hot-pluggable hardware when suspended. Don't attempt to load
-a snapshot with a different kernel image than the one it was created with.
-Shutdown any NFS or samba server/client before hibernating.
-</warn>
-
-<p>
-There are two different implementations for S4. The original one is swsusp,
-then there is the newer tuxonice (formerly suspend2) with a nicer interface
-(including fbsplash support). A <uri
-link="http://tuxonice.net/features.html#compare">feature comparison</uri> is
-available at the <uri link="http://www.tuxonice.net">tuxonice homepage</uri>.
-There used to be Suspend-to-Disk (pmdisk), a fork of swsusp, but it has been
-merged back.
-</p>
-
-<p>
-TuxOnIce is not included in the mainline kernel yet, therefore you either have
-to patch your kernel sources with the patches provided by <uri
-link="http://www.tuxonice.net">tuxonice.net</uri> or use
-<c>sys-kernel/tuxonice-sources</c>.
-</p>
-
-<p>
-The kernel part for both swusp and TuxOnIce is as follows:
-</p>
-
-<pre caption="Kernel configuration for the various suspend types">
-Power Management support ---&gt;
-  <comment>(hibernate with swsusp)</comment>
-  [*] Hibernation (aka 'suspend to disk')
-      <comment>(replace /dev/SWAP with your swap partition)</comment>
-      (/dev/SWAP)      Default resume partition
-
-  <comment>(hibernate with TuxOnIce)</comment>
-  Enhanced Hibernation (TuxOnIce)
-    --- Image Storage (you need at least one allocator)
-    [*]    File Allocator
-    [*]    Swap Allocator
-    ---   General Options
-    [*]    Compression support
-    [ ]     Allow Keep Image Mode
-    [*]     Replace swsusp by default
-</pre>
-
-<p>
-The configuration for swsusp is rather easy. If you didn't store the location
-of your swap partition in the kernel config, you can also pass it as a
-parameter with the <c>resume=/dev/SWAP</c> directive. If booting is not
-possible due to a broken image, use the <c>noresume</c> kernel parameter. The
-<c>hibernate-cleanup</c> init script invalidates swsusp images during the boot
-process.
-</p>
-
-<pre caption="Invalidating swsusp images during the boot process">
-# <i>rc-update add hibernate-cleanup boot</i>
-</pre>
-
-<p>
-To activate hibernate with swsusp, use the hibernate script and set
-<c>UseSysfsPowerState disk</c> in <path>/etc/hibernate/sysfs-disk</path>.
-</p>
-
-<warn>
-Backup your data before doing this. Run <c>sync</c> before executing one of the
-commands to have cached data written to disk. First try it outside of X, then
-with X running, but not logged in.
-</warn>
-
-<p>
-If you experience kernel panics due to uhci or similar, try to compile USB
-support as module and unload the modules before sending your laptop to sleep
-mode. There are configuration options for this in <path>common.conf</path>
-</p>
-
-<pre caption="Hibernating with swsusp">
-# <i>nano -w /etc/hibernate/common.conf</i>
-<comment>(Make sure you have a backup of your data)</comment>
-# <i>hibernate</i>
-</pre>
-
-<p>
-The following section discusses the setup of TuxOnIce including fbsplash support
-for a nice graphical progress bar during suspend and resume.
-</p>
-
-<p>
-The first part of the configuration is similar to the configuration of swsusp.
-In case you didn't store the location of your swap partition in the kernel
-config, you have to pass it as a kernel parameter with the
-<c>resume=swap:/dev/SWAP</c> directive. If booting is not possible due to a
-broken image, append the <c>noresume</c> parameter. Additionally, the
-<c>hibernate-cleanup</c> init script invalidates TuxOnIce images during the boot
-process.
-</p>
-
-<pre caption="Invalidating TuxOnIce images during the boot process">
-# <i>rc-update add hibernate-cleanup boot</i>
-</pre>
-
-<p>
-Now edit <path>/etc/hibernate/tuxonice.conf</path>, enable the <c>TuxOnIce</c>
-options you need. Do not enable the <c>fbsplash</c> options in
-<c>common.conf</c> just yet.
-</p>
-
-<pre caption="Hibernating with TuxOnIce">
-# <i>nano -w /etc/hibernate/tuxonice.conf</i>
-<comment>(Make sure you have a backup of your data)</comment>
-# <i>hibernate</i>
-</pre>
-
-<p>
-Please configure <c>fbsplash</c> now if you didn't do already. To enable
-fbsplash support during hibernation, the <c>sys-apps/tuxonice-userui</c> package
-is needed. Additionally, you've got to enable the <c>fbsplash</c> USE flag.
-</p>
-
-<pre caption="Installing tuxonice-userui">
-# <i>echo "sys-apps/tuxonice-userui fbsplash" >> /etc/portage/package.use</i>
-# <i>emerge tuxonice-userui</i>
-</pre>
-
-<p>
-The ebuild tells you to make a symlink to the theme you want to use. For
-example, to use the <c>livecd-2005.1</c> theme, run the following command:
-</p>
-
-<pre caption="Using the livecd-2005.1 theme during hibernation">
-# <i>ln -sfn /etc/splash/livecd-2005.1 /etc/splash/tuxonice</i>
-</pre>
-
-<p>
-If you don't want a black screen in the first part of the resume process, you
-have to add the <c>tuxoniceui_fbsplash</c> tool to your initrd image. Assuming
-you created the initrd image with <c>splash_geninitramfs</c> and saved it as
-<path>/boot/fbsplash-emergence-1024x768</path>, here's how to do that.
-</p>
-
-<pre caption="Adding tuxoniceui_fbsplash to an initrd image">
-# <i>mount /boot</i>
-# <i>mkdir ~/initrd.d</i>
-# <i>cp /boot/fbsplash-emergence-1024x768 ~/initrd.d/</i>
-# <i>cd ~/initrd.d</i>
-# <i>gunzip -c fbsplash-emergence-1024x768 | cpio -idm --quiet -H newc</i>
-# <i>rm fbsplash-emergence-1024x768</i>
-# <i>cp /usr/sbin/tuxoniceui_fbsplash sbin/</i>
-# <i>find . | cpio --quiet --dereference -o -H newc | gzip -9 > /boot/fbsplash-tuxonice-emergence-1024x768</i>
-</pre>
-
-<p>
-Afterwards adjust <path>grub.conf</path> (or <path>lilo.conf</path>) so that
-your TuxOnIce kernel uses
-<path>/boot/fbsplash-tuxonice-emergence-1024x768</path> as initrd image. You can
-now test a dry run to see if everything is setup correctly.
-</p>
-
-<pre caption="Test run for fbsplash hibernation">
-# <i>tuxoniceui_fbsplash -t</i>
-</pre>
-
-<p>
-Afterwards open <path>/etc/hibernate/common.conf</path> and activate the
-fbsplash options. Execute <c>hibernate</c> and enjoy.
-</p>
-
-</body>
-</section>
-</chapter>
-
-<chapter>
-<title>Troubleshooting</title>
-<section>
-<body>
-
-<p>
-<e>Q:</e> I'm trying to change the CPU frequency, but
-<path>/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor</path> does not
-exist.
-</p>
-
-<p>
-<e>A:</e> Make sure your processor supports CPU frequency scaling and you chose
-the right CPUFreq driver for your processor. Here is a list of processors that
-are supported by cpufreq (kernel 2.6.7): ARM Integrator, ARM-SA1100, ARM-SA1110,
-AMD Elan - SC400, SC410, AMD mobile K6-2+, AMD mobile K6-3+, AMD mobile Duron,
-AMD mobile Athlon, AMD Opteron, AMD Athlon 64, Cyrix Media GXm, Intel mobile
-PIII and Intel mobile PIII-M on certain chipsets, Intel Pentium 4, Intel Xeon,
-Intel Pentium M (Centrino), National Semiconductors Geode GX, Transmeta Crusoe,
-VIA Cyrix 3 / C3, UltraSPARC-III, SuperH SH-3, SH-4, several "PowerBook" and
-"iBook2" and various processors on some ACPI 2.0-compatible systems (only if
-"ACPI Processor Performance States" are available to the ACPI/BIOS interface).
-</p>
-
-<p>
-<e>Q:</e> My laptop supports frequency scaling, but
-<path>/sys/devices/system/cpu/cpu0/cpufreq/</path> is empty.
-</p>
-
-<p>
-<e>A:</e> Look for ACPI related error messages with <c>dmesg | grep ACPI</c>.
-Try to update the BIOS, especially if a broken DSDT is reported. You can also
-try to fix it yourself (which is beyond the scope of this guide).
-</p>
-
-<p>
-<e>Q:</e> My laptop supports frequency scaling, but according to
-<path>/proc/cpuinfo</path> the speed never changes.
-</p>
-
-<p>
-<e>A:</e> Probably you have activated symmetric multiprocessing support
-(CONFIG_SMP) in your kernel. Deactivate it and it should work. Some older
-kernels had a bug causing this. In that case, run <c>emerge x86info</c>, update
-your kernel as asked and check the current frequency with <c>x86info -mhz</c>.
-</p>
-
-<p>
-<e>Q:</e> I can change the CPU frequency, but the range is not as wide as in
-another OS.
-</p>
-
-<p>
-<e>A:</e> You can combine frequency scaling with ACPI throttling to get a lower
-minimum frequency. Notice that throttling doesn't save much energy and is mainly
-used for thermal management (keeping your laptop cool and quiet). You can read
-the current throttling state with <c>cat /proc/acpi/processor/CPU/throttling</c>
-and change it with <c>echo -n "0:x" > /proc/acpi/processor/CPU/limit</c>, where
-x is one of the Tx states listed in
-<path>/proc/acpi/processor/CPU/throttling</path>.
-</p>
-
-<p>
-<e>Q:</e> When configuring the kernel, powersave, performance and userspace
-governors show up, but that ondemand thing is missing. Where do I get it?
-</p>
-
-<p>
-<e>A:</e> The ondemand governor is only included in recent kernel sources. Try
-updating them.
-</p>
-
-<p>
-<e>Q:</e> Battery life time seems to be worse than before.
-</p>
-
-<p>
-<e>A:</e> Check your BIOS settings. Maybe you forgot to re-enable some of the
-settings.
-</p>
-
-<p>
-<e>Q:</e> My battery is charged, but KDE reports there would be 0% left and
-immediately shuts down.
-</p>
-
-<p>
-<e>A:</e> Check that battery support is compiled into your kernel. If you use
-it as a module, make sure the module is loaded.
-</p>
-
-<p>
-<e>Q:</e> My system logger reports things like "logger: ACPI group battery /
-action battery is not defined".
-</p>
-
-<p>
-<e>A:</e> This message is generated by the <path>/etc/acpi/default.sh</path>
-script that is shipped with acpid. You can safely ignore it. If you like to get
-rid of it, you can comment the appropriate line in
-<path>/etc/acpi/default.sh</path> as shown below:
-</p>
-
-<pre caption="Disabling warnings about unknown acpi events">
-        *)      # logger "ACPI action $action is not defined"
-</pre>
-
-<p>
-<e>Q:</e> I have a Dell Inspiron 51XX and I don't get any ACPI events.
-</p>
-
-<p>
-<e>A:</e> This seems to be a kernel bug. Read on <uri
-link="http://bugme.osdl.org/show_bug.cgi?id=1752">here</uri>.
-</p>
-
-<p>
-<e>Q:</e> I activated the <c>DynamicClocks</c> option in <path>xorg.conf</path>
-and now X.org crashes / the screen stays black / my laptop doesn't shutdown
-properly.
-</p>
-
-<p>
-<e>A:</e> This happens on some systems. You have to disable
-<c>DynamicClocks</c>.
-</p>
-
-<p>
-<e>Q:</e> I want to use TuxOnIce, but it tells me my swap partition is too
-small. Resizing is not an option.
-</p>
-
-<p>
-<e>A:</e> If there is enough free space on your system, you can use the
-filewriter instead of the swapwriter. The <c>hibernate-script</c> supports it as
-well. More information can be found in
-<path>/usr/src/linux/Documentation/power/tuxonice.txt</path>.
-</p>
-
-<p>
-<e>Q:</e> I just bought a brand new battery, but it only lasts for some
-minutes! What am I doing wrong?
-</p>
-
-<p>
-<e>A:</e> First follow your manufacturer's advice on how to charge the battery
-correctly.
-</p>
-
-<p>
-<e>Q:</e> The above didn't help. What should I do then?
-</p>
-
-<p>
-<e>A:</e> Some batteries sold as "new" are in fact old ones. Try the following:
-</p>
-
-<pre caption="Querying battery state">
-$ <i>grep capacity /proc/acpi/battery/BAT0/info</i>
-design capacity:     47520 mWh
-last full capacity:  41830 mWh
-</pre>
-
-<p>
-If the "last full capacity" differs significantly from the design capacity,
-your battery is probably broken. Try to claim your warranty.
-</p>
-
-<p>
-<e>Q:</e> My problem is not listed above. Where should I go next?
-</p>
-
-<p>
-<e>A:</e> Don't fear to contact me, <mail link="earthwings@g.o">Dennis
-Nienhüser</mail>, directly. The <uri link="http://forums.gentoo.org">Gentoo
-Forums</uri> are a good place to get help as well. If you prefer IRC, try the
-<c>#gentoo-laptop</c> <uri link="irc://irc.gentoo.org">channel</uri>.
-</p>
-
 </body>
 </section>
 </chapter>





Navigation:
Lists: gentoo-doc-cvs: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo commit in xml/htdocs/doc/en: power-management-guide.xml
Next by thread:
gentoo commit in xml/htdocs/doc/en: power-management-guide.xml
Previous by date:
gentoo commit in xml/htdocs/doc/en: gentoo-x86-quickinstall-system.xml
Next by date:
gentoo commit in xml/htdocs/doc/en/handbook: index.xml


Updated Jun 30, 2012

Summary: Archive of the gentoo-doc-cvs mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.