Difference between revisions of "TLP"

From ArchWiki
Jump to: navigation, search
(simplification and beautification of wikilinks (interactive))
(Tag: wiki-scripts)
 
(126 intermediate revisions by 45 users not shown)
Line 1: Line 1:
 
[[Category:Power management]]
 
[[Category:Power management]]
'''TLP''' is a set of scripts that bring you the benefits of advanced power management for Linux without the need to understand every technical detail. The default configuration provides optimized power saving out of the box.
+
[[ja:TLP]]
 +
{{Related articles start}}
 +
{{Related|Laptop}}
 +
{{Related|Laptop Mode Tools}}
 +
{{Related articles end}}
  
It was originally written by linrunner for Ubuntu. {{aur|tlp}} is available in the AUR.
+
From the [http://linrunner.de/en/tlp/tlp.html project page]:
 
Settings depending on the power source ac/bat:
 
* Kernel laptop mode, dirty buffer params and file system commit timeout
 
* Power aware process scheduler for multi-core/multi-threading
 
* Hard disk advanced power magement level (per disk)
 
* SATA aggressive link power management (ALPM)
 
* PCI Express active state power management (PCIe ASPM) - Kernel 2.6.35 and above
 
* Runtime power management for pci/spi/i2c 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:
+
:TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfill your specific requirements.
* Hard disk spin down timeout and I/O scheduler (per disk)
 
* USB autosuspend with blacklist
 
* Audio power saving mode - hda_intel, ac97
 
* Disable Wifi, bluetooth or WWAN devices upon system startup and shutdown
 
* Disable Wake On LAN
 
* 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 ==
Just install it from the [https://aur.archlinux.org/packages.php?ID=48464l AUR].  
+
 
After successful installation, you can start TLP by typing ''as root/with sudo'':
+
[[Install]] {{Pkg|tlp}} from the [[official repositories]] - pay attention to its optional dependencies that may help provide additional power saving.
tlp start
+
 
To start TLP as a daemon, add '''tlp''' to the DAEMONS section in {{ic|/etc/rc.conf}}
+
To complete TLP's install, you must [[enable]] the systemd services {{ic|tlp.service}} and {{ic|tlp-sleep.service}}. You should also [[mask]] the systemd service {{ic|systemd-rfkill.service}} and socket {{ic|systemd-rfkill.socket}} to avoid conflicts and assure proper operation of TLP's radio device switching options.
DAEMONS=( ... '''tlp''' ...)
+
 
 +
{{Note|{{ic|tlp.service}} starts {{ic|NetworkManager.service}} if it is available: {{bug|43733}}. If you use a different [[List_of_applications#Network_managers|network manager]], [[edit]] {{ic|tlp.service}}in order to remove the service (line {{ic|1=Wants=}}) or [[mask]] it.}}
 +
 
 +
=== ThinkPads only ===
 +
 
 +
For advanced battery functions, i.e. charge thresholds and recalibration, install the following package(s):
 +
 
 +
* {{Pkg|tp_smapi}} – tp-smapi is needed for battery charge thresholds, recalibration and specific status output of tlp-stat
 +
* {{Pkg|acpi_call}} – acpi-call is needed for battery charge thresholds and recalibration on Sandy Bridge and newer models (X220/T420, X230/T430 et al.)
 +
 
 +
See the TLP FAQ, section [http://linrunner.de/en/tlp/docs/tlp-faq.html#kernmod "Which kernel module?"], for details.
 +
 
 +
== Start ==
 +
 
 +
After installation TLP will be automatically activated upon system start. To start it immediately without reboot or to apply changed settings, use:
 +
 
 +
# tlp start
  
 
== Configuration ==
 
== Configuration ==
The config-file is located at {{ic|/etc/default/tlp}}. A full list of options is documented here: [https://github.com/linrunner/TLP/wiki/TLP-Configuration TLP Configuration]. To make use of the battery-related options, install and configure [[Tp_smapi]].
 
  
== Kernel 2.6.39 ==
+
The configuration file is located at {{ic|/etc/default/tlp}} and provides a "largely" optimized power saving by default. For a full explanation of options see: [http://linrunner.de/en/tlp/docs/tlp-configuration.html TLP configuration]. 
According to this [https://bbs.archlinux.org/viewtopic.php?pid=946633 thread], the kernel 2.6.39 does not allow user-settings to
+
 
/sys/module/pcie_aspm/parameters/policy
+
=== Btrfs ===
You can use PCIe ASPM settings by starting the kernel with
+
 
pcie_aspm=force
+
{{Accuracy|Hardware/kernel-specific quirk|section=Btrfs}}
== 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 {{ic|/etc/network/if-up.d/}}, which itself calls (''as root'')
+
To avoid filesystem corruption on btrfs formatted partitions, set:
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]]).
+
SATA_LINKPWR_ON_BAT=max_performance
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"
+
See also these links for discussion on this topic: [https://github.com/linrunner/TLP/issues/128 Github bug report], [https://www.reddit.com/r/archlinux/comments/4f5xvh/saving_power_is_the_btrfs_dataloss_warning_still/ Reddit follow-up discussion].
 +
 
 +
=== Bumblebee with NVIDIA driver ===
 +
 
 +
If you're running [[Bumblebee]] with NVIDIA driver, you need to disable power management for the GPU in TLP in order to make Bumblebee control the power of the GPU.
 +
 
 +
Run {{ic|lspci}} to determine the address of the GPU (such as 01:00.0), then set the value:
 +
 
 +
  RUNTIME_PM_BLACKLIST="01:00.0"
 +
 
 +
=== Radio Device Wizard ===
 +
 
 +
The Radio Device Wizard allows a more sophisticated management of radio devices depending on network connect/disconnect events. It requires [[NetworkManager]], {{Pkg|tlp-rdw}} and [[enabling]] {{ic|NetworkManager-dispatcher.service}}.
 +
 
 +
See [http://linrunner.de/en/tlp/docs/tlp-configuration.html#rdw TLP configuration] for details.
 +
 
 +
=== Command line ===
 +
 
 +
TLP provides several command line tools. See [http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html#commands TLP commands].
 +
 
 +
== Debugging ==
 +
You can display informations about the currently used Mode(AC/BAT) and applied configurations:
 +
 
 +
  # tlp-stat
 +
 
 +
== Features intentionally excluded ==
  
=== NetworkManager ===
+
* Fan control. See [[Fan speed control]] and [[ThinkPad Fan Control]]
linrunner has created a little script for NetworkManager , which sets the the Powersaving options. It should be located in {{ic|/etc/NetworkManager/dispatcher.d/02_tlp-ifup}}. Again, if everything is working ok, you do not need to add this script!
 
  
#!/bin/sh
+
* Backlight brightness. See [[Backlight]]
# 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 ===
+
== See also ==
Just add
 
POST_UP=tlp wifi $INTERFACE
 
to the config-file.
 
  
== External Links ==
+
* [http://linrunner.de/tlp TLP - Linux Advanced Power Management] - Project homepage & documentation.
* [https://github.com/linrunner/TLP/wiki/TLP-Linux-Advanced-Power-Management TLP Documentation]
 
* [https://github.com/linrunner/TLP/wiki/TLP-Configuration TLP Configuration] - Settings
 
* [https://github.com/linrunner/TLP/blob/master/debian/changelog TLP Changelog]
 
* [https://github.com/linrunner/TLP/wiki/TLP-Developer-Documentation TLP Developer Documentation]
 
* [http://thinkpad-wiki.org/TLP_-_Linux_Stromsparen TLP - Linux Stromsparen] – Dokumentation in deutsch
 

Latest revision as of 19:46, 7 August 2017

From the project page:

TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfill your specific requirements.

Installation

Install tlp from the official repositories - pay attention to its optional dependencies that may help provide additional power saving.

To complete TLP's install, you must enable the systemd services tlp.service and tlp-sleep.service. You should also mask the systemd service systemd-rfkill.service and socket systemd-rfkill.socket to avoid conflicts and assure proper operation of TLP's radio device switching options.

Note: tlp.service starts NetworkManager.service if it is available: FS#43733. If you use a different network manager, edit tlp.servicein order to remove the service (line Wants=) or mask it.

ThinkPads only

For advanced battery functions, i.e. charge thresholds and recalibration, install the following package(s):

  • tp_smapi – tp-smapi is needed for battery charge thresholds, recalibration and specific status output of tlp-stat
  • acpi_call – acpi-call is needed for battery charge thresholds and recalibration on Sandy Bridge and newer models (X220/T420, X230/T430 et al.)

See the TLP FAQ, section "Which kernel module?", for details.

Start

After installation TLP will be automatically activated upon system start. To start it immediately without reboot or to apply changed settings, use:

# tlp start

Configuration

The configuration file is located at /etc/default/tlp and provides a "largely" optimized power saving by default. For a full explanation of options see: TLP configuration.

Btrfs

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: Hardware/kernel-specific quirk (Discuss in Talk:TLP#Btrfs)

To avoid filesystem corruption on btrfs formatted partitions, set:

SATA_LINKPWR_ON_BAT=max_performance

See also these links for discussion on this topic: Github bug report, Reddit follow-up discussion.

Bumblebee with NVIDIA driver

If you're running Bumblebee with NVIDIA driver, you need to disable power management for the GPU in TLP in order to make Bumblebee control the power of the GPU.

Run lspci to determine the address of the GPU (such as 01:00.0), then set the value:

 RUNTIME_PM_BLACKLIST="01:00.0"

Radio Device Wizard

The Radio Device Wizard allows a more sophisticated management of radio devices depending on network connect/disconnect events. It requires NetworkManager, tlp-rdw and enabling NetworkManager-dispatcher.service.

See TLP configuration for details.

Command line

TLP provides several command line tools. See TLP commands.

Debugging

You can display informations about the currently used Mode(AC/BAT) and applied configurations:

 # tlp-stat

Features intentionally excluded

See also