Difference between revisions of "TLP"

From ArchWiki
Jump to: navigation, search
m (Remove deprecated instructions for deamonarray)
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
'''TLP''' is set of powersaving-scripts for Lenovo/IBM ThinkPads (c), which handle powersaving options according to the current power source. It was originally written by linrunner for Ubuntu.  
+
[[Category:Power management]]
A port is available at the [https://aur.archlinux.org/packages.php?ID=48464l AUR]. Although it is written for ThinkPads, it should work on other laptops as well, but without ThinkPad specific functions. Some features are:
+
'''TLP''' implements advanced power management for Linux. TLP is a pure command line tool with
* Kernel-Laptop-Mode and timouts for writeback of the filesystembuffer to hard disk
+
automated background tasks. It does not contain a GUI. The default configuration provides optimized power saving out of the box.  
* Advanced Power Management Level per hard disk
+
 
* I/O scheduler per hard disk
+
{{aur|tlp}} is available in the AUR. Read the the full documentation at the [http://linrunner.de/tlp project homepage].
* SATA Aggressive Link Power Management (ALPM)
+
 
* Wifi powersaving mode for wifi-cards with iwlagn driver
+
== Features ==
* battery-charging thresholds on some ThinkPads with (optionally) tp_smapi
+
Settings depending on the power source ac/bat:
* and some more...
+
* Kernel laptop mode and dirty buffer params
 +
* CPU scaling governor and mix/max frequencies
 +
* Power aware process scheduler for multi-core/hyper-threading
 +
* Hard disk advanced power magement level and spin down timeout (per disk)
 +
* SATA aggressive link power management (ALPM)
 +
* PCIe active state power management (PCIe ASPM) - Kernel 2.6.35 and above
 +
* Runtime power management for PCI(e) bus devices - Kernel 2.6.35 and above
 +
* Radeon graphics KMS power management - Kernel 2.6.35 and above, not fglrx
 +
* Wifi power saving mode -  depending on kernel/driver
 +
* Power off optical drive in drive bay (on battery)
 +
 
 +
Additional functions:
 +
* I/O scheduler (per disk)
 +
* USB autosuspend with blacklist (input devices excluded automatically)
 +
* Audio power saving mode - hda_intel, ac97
 +
* Enable or disable integrated radio devices upon system startup and shutdown
 +
* Restore radio device state on system startup (from previous shutdown).
 +
* Radio device wizard: switch radios upon network connect/disconnect and dock/undock
 +
* Disable Wake On LAN
 +
* Integrated wwan state is restored after suspend/hibernate
 +
* Untervolting of Intel processors - requires kernel with PHC-Patch
 +
* Battery charge thresholds - ThinkPads only
 +
* Recalibrate battery - ThinkPads only
  
 
== Installation ==
 
== Installation ==
Line 13: Line 35:
 
After successful installation, you can start TLP by typing ''as root/with sudo'':
 
After successful installation, you can start TLP by typing ''as root/with sudo'':
 
  tlp start
 
  tlp start
To start TLP as a daemon, add '''tlp''' to the DAEMONS section in {{Filename|/etc/rc.conf}}
+
To run TLP automatically upon system startup, enable the service via:
DAEMONS=( ... '''tlp''' ...)
+
  systemctl enable tlp-init.service
  
 
== Configuration ==
 
== Configuration ==
The config-file is located at {{Filename|/etc/default/tlp}}. A full list of options is documented here: [http://thinkpad-wiki.org/TLP_-_Stromspareinstellungen_fuer_Ubuntu www.thinkpad-wiki.org] (currently only in German language). To make use of the battery-charging option, install and configure [[Tp_smapi]].  
+
The config-file is located at {{ic|/etc/default/tlp}}. A full list of options is documented here: [http://linrunner.de/en/tlp/docs/tlp-configuration.html TLP Configuration]. To make use of the battery-related options, install and configure [[Tp_smapi]].  
 
+
== Wi-Fi ==
+
Some Intel Wi-Fi cards require to set their powersaving options '''after''' establishing connection. Therefore the original version of TLP adds a script to {{Filename|/etc/network/if-up.d/}}, which itself calls (''as root'')
+
tlp wifi $IFACE
+
where '''$IFACE''' is the current Interface (e.g. wlan0). In Arch Linux, there is no such possibility by default. If you own a wifi card, which is not supported out of the box, please use the post-up methods of your preferred networking manager (like [[netcfg]] oder [[NetworkManager]]).
+
If TLP sets the powersaving options properly on ac-state changed, you do not need to change anything. Check this, by issuing the following command twice, before and after unplugging your ac adapter:
+
iwconfig | grep "Power Management"
+
 
+
=== NetworkManager ===
+
Linrunner has created a little script for NetworkManager , which sets the the Powersaving options. It should be located in {{Filename|/etc/NetworkManager/dispatcher.d/02_tlp-ifup}}. Again, if everything is working ok, you do not need to add this script!
+
 
+
#!/bin/sh
+
# tlp - ifup hook
+
[ -n "$1" ] || exit 0
+
+
IWC=iwconfig
+
TLP=/usr/sbin/tlp
+
[ -x $TLP ] || exit 0
+
+
IFACE="$1"
+
case "$2" in
+
    up)
+
        if [ -z $($IWC $IFACE 2>&1 | grep "no wireless extensions") ]; then
+
            # interface is wifi
+
            $TLP wifi $IFACE
+
        elif [ "${IFACE#usb}" != "$IFACE" -o "${IFACE#hso}" != "$IFACE" -o "${IFACE#ppp}" != "$IFACE" ]; then
+
            # interface is (probably) wwan
+
            $TLP usb
+
        fi
+
        ;;
+
       
+
    *) # do nothing
+
        ;;
+
esac
+
exit 0
+
  
=== netcfg ===
+
== Kernel 2.6.39 ==
Just add
+
According to this [https://bbs.archlinux.org/viewtopic.php?pid=946633 thread], the kernel 2.6.39 does not allow user-settings to
  POST_UP=tlp wifi $INTERFACE
+
  /sys/module/pcie_aspm/parameters/policy
to the config-file.
+
You can use PCIe ASPM settings by starting the kernel with
 +
pcie_aspm=force
  
 
== External Links ==
 
== External Links ==
* TLP Documentaion at [http://thinkpad-wiki.org/TLP_-_Stromspareinstellungen_fuer_Ubuntu thinkpad-wiki.org] (in German)
+
* [http://linrunner.de/tlp TLP - Linux Advanced Power Management] - Project homepage & documentation
* TLP Developer Documentation at [http://thinkpad-wiki.org/TLP_Programmdokumentation thinkpad-wiki.org] (in German)
+

Revision as of 13:04, 14 November 2012

TLP implements advanced power management for Linux. TLP is a pure command line tool with automated background tasks. It does not contain a GUI. The default configuration provides optimized power saving out of the box.

tlpAUR is available in the AUR. Read the the full documentation at the project homepage.

Features

Settings depending on the power source ac/bat:

  • Kernel laptop mode and dirty buffer params
  • CPU scaling governor and mix/max frequencies
  • Power aware process scheduler for multi-core/hyper-threading
  • Hard disk advanced power magement level and spin down timeout (per disk)
  • SATA aggressive link power management (ALPM)
  • PCIe active state power management (PCIe ASPM) - Kernel 2.6.35 and above
  • Runtime power management for PCI(e) bus devices - Kernel 2.6.35 and above
  • Radeon graphics KMS power management - Kernel 2.6.35 and above, not fglrx
  • Wifi power saving mode - depending on kernel/driver
  • Power off optical drive in drive bay (on battery)

Additional functions:

  • I/O scheduler (per disk)
  • USB autosuspend with blacklist (input devices excluded automatically)
  • Audio power saving mode - hda_intel, ac97
  • Enable or disable integrated radio devices upon system startup and shutdown
  • Restore radio device state on system startup (from previous shutdown).
  • Radio device wizard: switch radios upon network connect/disconnect and dock/undock
  • Disable Wake On LAN
  • Integrated wwan state is restored after suspend/hibernate
  • Untervolting of Intel processors - requires kernel with PHC-Patch
  • Battery charge thresholds - ThinkPads only
  • Recalibrate battery - ThinkPads only

Installation

Just install it from the AUR. After successful installation, you can start TLP by typing as root/with sudo:

tlp start

To run TLP automatically upon system startup, enable the service via:

 systemctl enable tlp-init.service

Configuration

The config-file is located at /etc/default/tlp. A full list of options is documented here: TLP Configuration. To make use of the battery-related options, install and configure Tp_smapi.

Kernel 2.6.39

According to this thread, the kernel 2.6.39 does not allow user-settings to

/sys/module/pcie_aspm/parameters/policy

You can use PCIe ASPM settings by starting the kernel with

pcie_aspm=force

External Links