Power Management

From Funtoo
Revision as of 22:58, 11 November 2011 by Hoverbear (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Note: This page is a work in progress.

[edit] Who is this for?

The majority of people who will be interested in power management on Funtoo will be split into the following two cases:

  • Laptop users
  • Low Power Workstation/Server users

This article is currently almost exclusively directed at laptop users.

[edit] Why bother?

Battery life, environmentalism, obsessiveness.

The author of this article saw a huge improvement in battery life after setting up necessary options, jumping from a 5:37 hour ACPI estimate to over 11 hours! (Thinkpad T420, 9-cell battery)

We've only got one planet right now, resources are limited, so why not use them wisely? Saving power reduces strain on your infrastructure and might save a couple furry bear cubs down the road. Also note that a reduction in power consumption means a reduction in your electricity bill.

[edit] The trade-off

First of all, you need to decide how much performance (if any) you're willing to sacrifice for a reduction in power.

Tools like laptop-mode and cpufreqd can cause a reduction in performance, however with careful configuration you can make this minimal while maintaining most of the benefits. Throughout this guide make sure to read comments in configuration files and decide what you need and want.

[edit] Getting started


[edit] Using Gentoo's resources

You'll find a fantastically written starter guide on the Gentoo site [1], note however that you are not required to use Gentoo-Sources. (Making your own kernel is a boatload of fun though! You're missing out.)

[edit] Laptop-mode-tools

Laptop-mode-tools should be reasonably well configured out of the box.

vim /etc/laptop-mode/laptop-mode.conf

Make sure it's enabled:

###############################################################################
# Enable/Disable laptop-mode-tools execution
# ------------------------------------------
# Set it to 0 to completely disable laptop-mode-tools from running
###############################################################################
#
ENABLE_LAPTOP_MODE_TOOLS=1

Next declare when to use laptop-mode:

# Enable laptop mode when on battery power.
#
ENABLE_LAPTOP_MODE_ON_BATTERY=1

# Enable laptop mode when on AC power.
#
ENABLE_LAPTOP_MODE_ON_AC=0

Next you will probably be safe to enable AUTO_MODULES with:


ENABLE_AUTO_MODULES=1

However, provided you're not using HAL (You shouldn't be, it's deprecated and is replaced by udev) you may want to disable the HAL module explicitly:

vim /etc/laptop-mode/conf.d/hal-polling.conf
----
CONTROL_HAL_POLLING=0

Finally, lets start up laptop_mode, then add it to our init.

/etc/init.d/laptop_mode start

rc-update add laptop_mode default