There are quite a few tools exists to power saving and battery life extension in Laptops. We already have looked at two tools namely Laptop Mode Tools and Powertop that improves the Linux Laptop battery performance. Today we will discuss yet another Laptop power management utility named TLP. TLP is a feature-rich commandline tool to optimize Laptop battery life in Linux.
Table of Contents
What is TLP?
TLP is an advanced power management tool for Linux. Its goal is to improve battery life on laptops running Linux without the need for complex configurations.
TLP requires zero configuration. TLP comes with a default configuration that's already optimized for battery life. It implements Powertop's recommendations out of the box. So users can simply install it and forget about it.
Some of the things TLP handles include:
- Power source-dependent configuration (whether you're running on battery or AC power)
- Processor frequency scaling including "turbo boost" / "turbo core"
- Power-saving settings for your hard disk or SSD
- Runtime power management for PCI(e) bus devices
- Wi-Fi power saving mode
- And more.
TLP will apply these settings automatically depending on your power source. It's a great tool for Linux laptop users who want to maximize their battery life with minimal hassle.
TLP takes care of everything. Even though TLP's default settings are just enough to provide optimal battery life, it is highly customizable to fulfill a specific requirement.
Install TLP in Linux
TLP is packaged for many Linux distributions including Arch Linux, Debian, Fedora, Gentoo, openSUSE and Ubuntu.
To install TLP in Arch Linux and its variants, run:
$ sudo pacman -S tlp tlp-rdw
If you're using Thinkpad, you need to install any one of the following packages. If you don't know exactly which package to install, run tlp-stat -b command as sudo or root user. It will guide you which package to install.
- acpi_call-lts (Community) – This is an optional external kernel module for the LTS kernel. It provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer models.
- tp_smapi (Community) – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.
- tp_smapi-lts (Community) – This is optional. Use it instead of tp_smapi when the LTS kernel is installed.
Install the appropriate package using your preferred package manager or with the following command:
$ sudo pacman -S acpi_call
Replace acpi_call with acpi_call-lts, tp_smapi or tp_smapi-lts where suitable.
On Debian:
$ sudo apt install tlp tlp-rdw
If you are using any Thinkpad model Laptops, you may need to install any one of the following packages. The output of tlp-stat -b will guide you which package to install.
- acpi-call-dkms (main) – This is an optional external kernel module that provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer.
- tp-smapi-dkms (main) – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.
Install the appropriate package using your preferred package manager or with the following command:
$ sudo apt install acpi-call-dkms
Replace 'acpi-call-dkms' with 'tp-smapi-dkms' as needed.
On Fedora:
$ sudo dnf install tlp tlp-rdw
If you use any Thinkpad model Laptops, install any one of the following packages. The dependencies of following packages are not available in the default repositories. So, first enable RPM Fusion repository in Fedora and then install the appropriate packages. If you don't know which package to install, run tlp-stat -b command as sudo or root user.
- kernel-devel (Fedora repo) – This is required to build the kernel module from the akmod package.
- akmod-tp_smapi (ThinkPad Extras repo) – This is an optional external kernel module source that provides battery charge thresholds and recalibration.
On openSUSE:
$ sudo zypper install tlp tlp-rdw
For Thinkpads, install the appropriate packages.
- acpi_call – This is an optional external kernel module that provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer.
- tp_smapi – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.
On Ubuntu:
To install TLP in Ubuntu and its derivatives, add the TLP official PPA:
$ sudo add-apt-repository ppa:linrunner/tlp
And install TLP using command:
$ sudo apt install tlp tlp-rdw
For Thinkpad Laptops, install the appropriate packages:
- acpi-call-dkms (PPA or universe) – This is an optional external kernel module that provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer.
- tp-smapi-dkms (universe) – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.
You can install the appropriate package either using your preferred package manager or with the following command:
$ sudo apt install acpi-call-dkms
If necessary, replace 'acpi-call-dkms' with 'tp-smapi-dkms'.
Again if you don't know which package to install, run tlp-stat -b command as sudo or root.
Enable and start TLP service
After installing TLP on your Linux machine, make sure it is enabled on startup and start the service using commands:
$ sudo systemctl enable tlp.service
$ sudo systemctl start tlp.service
You should also mask the following services to avoid conflicts and assure proper operation of TLP's Radio Device Switching options:
$ sudo systemctl mask systemd-rfkill.service
$ sudo systemctl mask systemd-rfkill.socket
Optimize Laptop Battery Life with TLP in Linux
As I already mentioned, TLP requires NO configuration. It works out of the box! The default settings are well optimized for better Laptop battery life. You can view these default settings in the TLP default configuration file, which is located at /etc/tlp.conf.
To view the current TLP configurion, system information, active power saving settings and battery data, run:
$ sudo tlp-stat
Sample output:
--- TLP 1.3.1 -------------------------------------------- +++ Configured Settings: defaults.conf L0004: TLP_ENABLE="1" defaults.conf L0005: TLP_PERSISTENT_DEFAULT="0" defaults.conf L0006: DISK_IDLE_SECS_ON_AC="0" defaults.conf L0007: DISK_IDLE_SECS_ON_BAT="2" defaults.conf L0008: MAX_LOST_WORK_SECS_ON_AC="15" defaults.conf L0009: MAX_LOST_WORK_SECS_ON_BAT="60" defaults.conf L0010: CPU_ENERGY_PERF_POLICY_ON_AC="balance_performance" defaults.conf L0011: CPU_ENERGY_PERF_POLICY_ON_BAT="balance_power" defaults.conf L0012: SCHED_POWERSAVE_ON_AC="0" defaults.conf L0013: SCHED_POWERSAVE_ON_BAT="1" defaults.conf L0014: NMI_WATCHDOG="0" defaults.conf L0015: DISK_DEVICES="nvme0n1 sda" defaults.conf L0016: DISK_APM_LEVEL_ON_AC="254 254" defaults.conf L0017: DISK_APM_LEVEL_ON_BAT="128 128" defaults.conf L0018: DISK_IOSCHED="keep keep" defaults.conf L0019: SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance" defaults.conf L0020: SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power" defaults.conf L0021: AHCI_RUNTIME_PM_TIMEOUT="15" defaults.conf L0022: PCIE_ASPM_ON_AC="default" defaults.conf L0023: PCIE_ASPM_ON_BAT="default" defaults.conf L0024: RADEON_POWER_PROFILE_ON_AC="default" defaults.conf L0025: RADEON_POWER_PROFILE_ON_BAT="default" defaults.conf L0026: RADEON_DPM_PERF_LEVEL_ON_AC="auto" defaults.conf L0027: RADEON_DPM_PERF_LEVEL_ON_BAT="auto" defaults.conf L0028: WIFI_PWR_ON_AC="off" defaults.conf L0029: WIFI_PWR_ON_BAT="on" defaults.conf L0030: WOL_DISABLE="Y" defaults.conf L0031: SOUND_POWER_SAVE_ON_AC="0" defaults.conf L0032: SOUND_POWER_SAVE_ON_BAT="1" defaults.conf L0033: SOUND_POWER_SAVE_CONTROLLER="Y" defaults.conf L0034: BAY_POWEROFF_ON_AC="0" defaults.conf L0035: BAY_POWEROFF_ON_BAT="0" defaults.conf L0036: BAY_DEVICE="sr0" defaults.conf L0037: RUNTIME_PM_ON_AC="on" defaults.conf L0038: RUNTIME_PM_ON_BAT="auto" defaults.conf L0039: RUNTIME_PM_DRIVER_BLACKLIST="amdgpu mei_me nouveau nvidia pcieport radeon" /etc/tlp.conf L0323: USB_AUTOSUSPEND="0" defaults.conf L0041: USB_BLACKLIST_BTUSB="0" defaults.conf L0042: USB_BLACKLIST_PHONE="0" defaults.conf L0043: USB_BLACKLIST_PRINTER="1" defaults.conf L0044: USB_BLACKLIST_WWAN="0" defaults.conf L0045: USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN="0" defaults.conf L0046: RESTORE_DEVICE_STATE_ON_STARTUP="0" defaults.conf L0047: RESTORE_THRESHOLDS_ON_BAT="0" defaults.conf L0048: NATACPI_ENABLE="1" defaults.conf L0049: TPACPI_ENABLE="1" defaults.conf L0050: TPSMAPI_ENABLE="1" +++ System Info System = Dell Inc. Not Specified Inspiron N5050 BIOS = A05 Release = "Fedora release 34 (Thirty Four)" Kernel = 5.11.17-300.fc34.x86_64 #1 SMP Wed Apr 28 14:21:28 UTC 2021 x86_64 BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.11.17-300.fc34.x86_64 root=UUID=2dbf3f8b-de51-413e-8872-5fb61c06cb8f ro rootflags=subvol=root rhgb quiet Init system = systemd Boot mode = BIOS (CSM, Legacy) SELinux status = enabled (enforcing) <strong> +++ TLP Status State = enabled RDW state = enabled</strong> Last run = 02:46:11 PM IST, 53 sec(s) ago Mode = battery Power source = battery [...]
Disable USB auto suspend
When TLP is started with default configuration, some USB devices will be automatically suspended to save power when your Laptop is running on battery.
To disable USB autosuspend, edit /etc/tlp.conf file:
$ sudo nano /etc/tlp.conf
Find the following line and set its value as 0.
USB_AUTOSUSPEND=0
You can also exclude specific devices from USB autosuspend (separate with spaces). First, use lsusb command to get the ids. Then, mention the device ids with space-separated like below
USB_BLACKLIST="8078:0014 065d:8023"
Save and close the file by pressing CTRL+O followed by CTRL+X.
Force battery (BAT) configuration
When no power supply is detected, the setting for AC will be used on devices like desktops and embedded hardware. If you want to force the battery (BAT) settings when using TLP on these devices to enable more power saving, edit /etc/tlp.conf file:
$ sudo nano /etc/tlp.conf
Find the following lines and set their values as shown here:
# Operation mode when no power supply can be detected: AC, BAT. TLP_DEFAULT_MODE=BAT # Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE TLP_PERSISTENT_DEFAULT=1
For more details, check the TLP website and its GitHub page given at the end.
Frequently Asked Questions
Q1: What is TLP?A: TLP is a power management tool for Linux-based systems. It optimizes battery life by managing system settings such as power source preferences, CPU speed, hard disk spins, and Wi-Fi power saving.
Q2: Does TLP require configuration?A: No, TLP comes pre-configured and generally works well with the default settings. However, users can modify its configuration to better suit their needs.
Q3: How do I install TLP?A: TLP can be installed via the terminal using package management commands like apt for Debian/Ubuntu based systems, or dnf for Fedora systems.
Q4: Can TLP help with overheating issues?A: Yes, TLP can help manage system heat by intelligently controlling system settings that affect power consumption and heat generation.
Q5: How do I check if TLP is running?A: You can check if TLP is running by using the terminal command sudo tlp-stat -s.
Q6: Does TLP work on all laptops?A: TLP is designed to work with most modern laptops, but its effectiveness may vary depending on the specific model and hardware.
Q7: Can I use TLP on desktop systems?A: While TLP is primarily designed for laptops, it can also be used on desktop systems for some of its features. However, the benefits on a desktop may be less noticeable.
Q8: Is TLP free to use?A: Yes, TLP is open-source and free to use. It's licensed under GPLv2.
Conclusion
TLP is one of the recommended application that you should install on your Linux laptop. It is also worth mentioning that you should not use multiple power saving utilities simultaneously. The TLP’s settings get overwritten by the other tools settings and vice versa, so you may not get optimal result. It is always recommended to use only TLP and remove other similar tools.
Resources:
- TLP website
- TLP GitHub Repository
Related read:
- Automatically Optimize CPU Speed And Power With Auto-cpufreq In Linux
- CPU Power Manager – Control And Manage CPU Frequency In Linux
- How To Check Laptop Battery Status And Level In Terminal In Linux
Featured image by mohamed Hassan from Pixabay.
以上がLinuxでTLPでラップトップのバッテリー寿命を最適化する方法の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

インターネットは単一のオペレーティングシステムに依存していませんが、Linuxはその上で重要な役割を果たしています。 Linuxは、サーバーやネットワークデバイスで広く使用されており、安定性、セキュリティ、スケーラビリティに人気があります。

Linuxオペレーティングシステムのコアは、コマンドラインインターフェイスで、コマンドラインを介してさまざまな操作を実行できます。 1.ファイルおよびディレクトリ操作は、ファイルとディレクトリを管理するために、LS、CD、MKDIR、RM、その他のコマンドを使用します。 2。ユーザーおよび許可管理は、useradd、passwd、chmod、その他のコマンドを介してシステムのセキュリティとリソースの割り当てを保証します。 3。プロセス管理は、PS、Kill、およびその他のコマンドを使用して、システムプロセスを監視および制御します。 4。ネットワーク操作には、Ping、Ifconfig、SSH、およびネットワーク接続を構成および管理するためのその他のコマンドが含まれます。 5.システムの監視とメンテナンスは、TOP、DF、DUなどのコマンドを使用して、システムの動作ステータスとリソースの使用を理解します。

導入 Linuxは、柔軟性と効率性により、開発者、システム管理者、およびパワーユーザーが好む強力なオペレーティングシステムです。しかし、頻繁に長く複雑なコマンドを使用することは退屈でERです

Linuxは、サーバー、開発環境、埋め込みシステムに適しています。 1.サーバーオペレーティングシステムとして、Linuxは安定して効率的であり、多くの場合、高電流アプリケーションの展開に使用されます。 2。開発環境として、Linuxは効率的なコマンドラインツールとパッケージ管理システムを提供して、開発効率を向上させます。 3.埋め込まれたシステムでは、Linuxは軽量でカスタマイズ可能で、リソースが限られている環境に適しています。

はじめに:Linuxベースの倫理的ハッキングでデジタルフロンティアを保護します ますます相互に接続されている世界では、サイバーセキュリティが最重要です。 倫理的なハッキングと浸透テストは、脆弱性を積極的に特定し、緩和するために不可欠です

基本的なLinux学習の方法は次のとおりです。1。ファイルシステムとコマンドラインインターフェイス、2。LS、CD、MKDIR、3。ファイルの作成と編集などのファイル操作を学習するマスター基本コマンド、4。

Linuxは、サーバー、組み込みシステム、デスクトップ環境で広く使用されています。 1)サーバーフィールドでは、Linuxは、その安定性とセキュリティにより、Webサイト、データベース、アプリケーションをホストするための理想的な選択肢となっています。 2)埋め込みシステムでは、Linuxは高いカスタマイズと効率で人気があります。 3)デスクトップ環境では、Linuxはさまざまなユーザーのニーズを満たすために、さまざまなデスクトップ環境を提供します。

Linuxの欠点には、ユーザーエクスペリエンス、ソフトウェア互換性、ハードウェアサポート、学習曲線が含まれます。 1.ユーザーエクスペリエンスは、WindowsやMacOほどフレンドリーではなく、コマンドラインインターフェイスに依存しています。 2。ソフトウェアの互換性は他のシステムほど良くなく、多くの商用ソフトウェアのネイティブバージョンがありません。 3.ハードウェアサポートはWindowsほど包括的ではなく、ドライバーは手動でコンパイルされる場合があります。 4.学習曲線は急で、コマンドラインの操作をマスターするには時間と忍耐が必要です。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

Safe Exam Browser
Safe Exam Browser は、オンライン試験を安全に受験するための安全なブラウザ環境です。このソフトウェアは、あらゆるコンピュータを安全なワークステーションに変えます。あらゆるユーティリティへのアクセスを制御し、学生が無許可のリソースを使用するのを防ぎます。

MinGW - Minimalist GNU for Windows
このプロジェクトは osdn.net/projects/mingw に移行中です。引き続きそこでフォローしていただけます。 MinGW: GNU Compiler Collection (GCC) のネイティブ Windows ポートであり、ネイティブ Windows アプリケーションを構築するための自由に配布可能なインポート ライブラリとヘッダー ファイルであり、C99 機能をサポートする MSVC ランタイムの拡張機能が含まれています。すべての MinGW ソフトウェアは 64 ビット Windows プラットフォームで実行できます。

SecLists
SecLists は、セキュリティ テスターの究極の相棒です。これは、セキュリティ評価中に頻繁に使用されるさまざまな種類のリストを 1 か所にまとめたものです。 SecLists は、セキュリティ テスターが必要とする可能性のあるすべてのリストを便利に提供することで、セキュリティ テストをより効率的かつ生産的にするのに役立ちます。リストの種類には、ユーザー名、パスワード、URL、ファジング ペイロード、機密データ パターン、Web シェルなどが含まれます。テスターはこのリポジトリを新しいテスト マシンにプルするだけで、必要なあらゆる種類のリストにアクセスできるようになります。

WebStorm Mac版
便利なJavaScript開発ツール

ドリームウィーバー CS6
ビジュアル Web 開発ツール
