Improve Power Usage / Battery Life and Temperature with TLP

Discuss *nix based Software here


Improve Power Usage / Battery Life and Temperature with TLP

Postby tanmay.01 » Wed Apr 17, 2013 7:29 am

There are various tweaks that you can apply to your laptop to save battery power, but many of them depend on the hardware, Linux distribution, some are outdated or too hard to apply for regular users and so on. TLP is an advanced power management command line tool for Linux that tries to apply these settings / tweaks for you automatically, depending on your Linux distribution and hardware.

TLP applies the following settings depending on the power source (battery / ac):

Kernel laptop mode and dirty buffer timeouts;
Processor frequency scaling including "turbo boost" / "turbo core";
Power aware process scheduler for multi-core/hyper-threading;
Hard disk advanced power management level and spin down timeout (per disk);
SATA aggressive link power management (ALPM);
PCI Express active state power management (PCIe ASPM) – Linux 2.6.35 and above;
Runtime power management for PCI(e) bus devices – Linux 2.6.35 and above;
Radeon KMS power management – Linux 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 TLP functions:

I/O scheduler (per disk);
USB autosuspend with blacklist;
Audio power saving mode – hda_intel, ac97;
Enable or disable integrated wifi, bluetooth or wwan 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;
WWAN state is restored after suspend/hibernate;
Undervolting of Intel processors – requires kernel with PHC-Patch;
Battery charge thresholds – ThinkPads only;
Recalibrate battery – ThinkPads only.


TLP applies these settings automatically on startup and every time you change the power source. To use it, all you have to do is install TLP, however, there are some settings that you can apply manually, overwriting the TLP default settings, such as enabling or disabling the WiFi, Bluetooth or Wwan (3G or UMTS) radios, switching between AC or battery settings, ignoring the actual power source, apply autosuspend for all attached USB devices or power off the optical drive.

There are also some TinkPad-only settings that you can use, like temporarily changing the battery charge thresholds, temporarily set battery charge thresholds to factory settings, recalibrating the battery and more.

For more about these settings, see the TLP homepage or consult the TLP manpage (type "man tlp" in a terminal).

I've only been using TLP for a couple of hours so I can't say yet how efficient this tool is regarding battery life, but I've noticed that my laptop's temperature is lower than before using TLP. You may have seen an icon on my Unity launcher in some posts on WebUpd8, which displays a number that's usually around 65 - that's Psensor and it displays the CPU temperature (Celsius; it's 165 degrees Fahrenheit) - here's an example. Well, after installing TLP, the CPU temperature didn't go past 55 degrees Celsius (135 degrees Fahrenheit), at least not yet, with regular desktop usage: using a browser with quite a few tabs open, a text editor and a few AppIndicators running, under Unity. This, of course, depends on various factors but so far this tool seems to do its job. Also, some Reddit users have reported that TLP makes quite a big difference.



Install TLP in Ubuntu

Before proceeding with the installation, there are a couple of things you need to do:

firstly, if you've added any power saving settings / scripts (e.g.: in /etc/rc.local), remove them or else TLP may not work properly;
remove laptop-mode-tools ("sudo apt-get remove laptop-mode-tools").


Ubuntu (and Linux Mint, etc.) users can install TLP by using its official PPA. Add the PPA and install TLP using the following commands:

Code: Select all
sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp tlp-rdw


TLP will automatically start upon system startup, but to avoid having to restart the system to get it running for the first time, you can start it (required only the first time) using the following command:

Code: Select all
sudo tlp start


There are some optional packages you can install for some extra features:

smartmontools - needed to display disk drive S.M.A.R.T. data;
ethtool - needed to disable wake on lan.

Install these tools (available in the Ubuntu repositories) using the following command:

Code: Select all
sudo apt-get install smartmontools ethtool


There are also some ThinkPad only, optional packages you may need:

tp-smapi-dkms - needed for battery charge thresholds and ThinkPad specific status output of tlp-stat;
acpi-call-tools - acpi-call is needed for battery charge thresholds on Sandy Bridge and newer models (X220/T420, X230/T430, etc.).


Install these packages using the following command:

Code: Select all
sudo apt-get install tp-smapi-dkms acpi-call-tools


Make sure to also read the TLP FAQ.

Source : Webupd8

I have tested this on my HP Envy 15 with xubuntu 13.04 and i must say its way toooo cooler than tha 12.10 etc... ditto like windows.

To view stats :
Code: Select all
tlp-stat


Here are my stats :
--- TLP 0.3.8.1 --------------------------------------------

+++ Configured Settings: /etc/default/tlp
TLP_ENABLE=1
DISK_IDLE_SECS_ON_AC=0
DISK_IDLE_SECS_ON_BAT=2
MAX_LOST_WORK_SECS_ON_AC=15
MAX_LOST_WORK_SECS_ON_BAT=60
SCHED_POWERSAVE_ON_AC=0
SCHED_POWERSAVE_ON_BAT=1
NMI_WATCHDOG=0
DISK_DEVICES="sda sdb"
DISK_APM_LEVEL_ON_AC="254 254"
DISK_APM_LEVEL_ON_BAT="128 128"
SATA_LINKPWR_ON_AC=max_performance
SATA_LINKPWR_ON_BAT=min_power
PCIE_ASPM_ON_AC=performance
PCIE_ASPM_ON_BAT=powersave
RADEON_POWER_PROFILE_ON_AC=high
RADEON_POWER_PROFILE_ON_BAT=low
WIFI_PWR_ON_AC=1
WIFI_PWR_ON_BAT=5
WOL_DISABLE=Y
SOUND_POWER_SAVE=1
SOUND_POWER_SAVE_CONTROLLER=Y
BAY_POWEROFF_ON_BAT=0
BAY_DEVICE="sr0"
RUNTIME_PM_ON_AC=on
RUNTIME_PM_ON_BAT=auto
RUNTIME_PM_ALL=0
USB_AUTOSUSPEND=1
RESTORE_DEVICE_STATE_ON_STARTUP=0

+++ System Info
System = Hewlett-Packard 078F110000204810000620100 HP ENVY 15 Notebook PC
BIOS = F.07
Release = Ubuntu Raring Ringtail (development branch)
Kernel = 3.8.0-18-generic x86_64
/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-3.8.0-18-generic root=UUID=72d950f3-8c0b-47ac-aa9b-825e2afedd14 ro quiet splash vt.handoff=7

+++ System Status
TLP power save = enabled
power source = ac

+++ Processor
CPU Model = Intel(R) Core(TheeMahn) i5-3210M CPU @ 2.50GHz

/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 1200000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 2501000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies = 2501000 2500000 2400000 2300000 2200000 2100000 2000000 1900000 1800000 1700000 1600000 1500000 1400000 1300000 1200000 [kHz]

/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = ondemand
/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 1200000 [kHz]
/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 2501000 [kHz]
/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_frequencies = 2501000 2500000 2400000 2300000 2200000 2100000 2000000 1900000 1800000 1700000 1600000 1500000 1400000 1300000 1200000 [kHz]

/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = ondemand
/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 1200000 [kHz]
/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 2501000 [kHz]
/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_frequencies = 2501000 2500000 2400000 2300000 2200000 2100000 2000000 1900000 1800000 1700000 1600000 1500000 1400000 1300000 1200000 [kHz]

/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = ondemand
/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 1200000 [kHz]
/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 2501000 [kHz]
/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_frequencies = 2501000 2500000 2400000 2300000 2200000 2100000 2000000 1900000 1800000 1700000 1600000 1500000 1400000 1300000 1200000 [kHz]

/sys/devices/system/cpu/cpufreq/boost = 1
/proc/sys/kernel/nmi_watchdog = 0

+++ Undervolting
PHC kernel not available.

+++ Temperatures
CPU temp = 47 [°C]
Fan speed = (not available)

+++ File System
/proc/sys/vm/laptop_mode = 0
/proc/sys/vm/dirty_writeback_centisecs = 1500
/proc/sys/vm/dirty_expire_centisecs = 1500
/proc/sys/vm/dirty_ratio = 60
/proc/sys/vm/dirty_background_ratio = 1
/proc/sys/fs/xfs/age_buffer_centisecs = (not available)
/proc/sys/fs/xfs/xfssyncd_centisecs = (not available)
/proc/sys/fs/xfs/xfsbufd_centisecs = (not available)

+++ Storage Devices
/dev/sda:
Model = Hitachi HTS727575A9E364
Firmware = JF4OA0E0
APM Level = 254
Status = active/idle
scheduler = deadline

SMART info:
4 Start_Stop_Count = 2207
5 Reallocated_Sector_Ct = 0
9 Power_On_Hours = 1746 [h]
190 Airflow_Temperature_Cel = 38 [°C]
193 Load_Cycle_Count = 65437


+++ SATA Aggressive Link Power Management
/sys/class/scsi_host/host0/link_power_management_policy = max_performance
/sys/class/scsi_host/host1/link_power_management_policy = max_performance
/sys/class/scsi_host/host2/link_power_management_policy = max_performance
/sys/class/scsi_host/host3/link_power_management_policy = max_performance
/sys/class/scsi_host/host4/link_power_management_policy = max_performance
/sys/class/scsi_host/host5/link_power_management_policy = max_performance

+++ PCIe Active State Power Management
/sys/module/pcie_aspm/parameters/policy = default (using bios preferences)

+++ Intel Graphics
/sys/module/i915/parameters/powersave = 1 (enabled)
/sys/module/i915/parameters/i915_enable_rc6 = -1 (use per-chip default)
/sys/module/i915/parameters/i915_enable_fbc = -1 (use per-chip default)
/sys/module/i915/parameters/lvds_downclock = 0 (disabled)
/sys/module/i915/parameters/semaphores = -1 (use per-chip default)

+++ Radeon Graphics
/sys/class/drm/card1/device/power_method = profile
/sys/class/drm/card1/device/power_profile = high

+++ Wireless
bluetooth = on
wifi = on
wwan = none (no device)

wlan0(iwlwifi): power management = off

+++ Audio
/sys/module/snd_hda_intel/parameters/power_save = 1
/sys/module/snd_hda_intel/parameters/power_save_controller = Y

+++ Battery Status
/sys/class/power_supply/BAT0/manufacturer = Hewlett-Packard
/sys/class/power_supply/BAT0/model_name = Primary
/sys/class/power_supply/BAT0/cycle_count = 0
/sys/class/power_supply/BAT0/charge_full_design = 5035 [mAh]
/sys/class/power_supply/BAT0/charge_full = 5035 [mAh]
/sys/class/power_supply/BAT0/charge_now = 5035 [mAh]
/sys/class/power_supply/BAT0/current_now = 0 [mA]
/sys/class/power_supply/BAT0/status = Full

+++ Runtime Power Management
/sys/bus/pci/devices/0000:00:00.0/power/control = on (0x060000 Host bridge)
/sys/bus/pci/devices/0000:00:01.0/power/control = on (0x060400 PCI bridge)
/sys/bus/pci/devices/0000:00:02.0/power/control = on (0x030000 VGA compatible controller)
/sys/bus/pci/devices/0000:00:14.0/power/control = on (0x0c0330 USB controller)
/sys/bus/pci/devices/0000:00:16.0/power/control = on (0x078000 Communication controller)
/sys/bus/pci/devices/0000:00:1a.0/power/control = on (0x0c0320 USB controller)
/sys/bus/pci/devices/0000:00:1b.0/power/control = on (0x040300 Audio device)
/sys/bus/pci/devices/0000:00:1c.0/power/control = on (0x060400 PCI bridge)
/sys/bus/pci/devices/0000:00:1c.2/power/control = on (0x060400 PCI bridge)
/sys/bus/pci/devices/0000:00:1c.4/power/control = on (0x060400 PCI bridge)
/sys/bus/pci/devices/0000:00:1d.0/power/control = on (0x0c0320 USB controller)
/sys/bus/pci/devices/0000:00:1f.0/power/control = on (0x060100 ISA bridge)
/sys/bus/pci/devices/0000:00:1f.2/power/control = on (0x010601 SATA controller)
/sys/bus/pci/devices/0000:00:1f.3/power/control = on (0x0c0500 SMBus)
/sys/bus/pci/devices/0000:01:00.0/power/control = on (0x030000 VGA compatible controller)
/sys/bus/pci/devices/0000:07:00.0/power/control = on (0x028000 Network controller)
/sys/bus/pci/devices/0000:08:00.0/power/control = on (0xff0000 Unassigned class [ff00])
/sys/bus/pci/devices/0000:0e:00.0/power/control = on (0x020000 Ethernet controller)

+++ USB
tlp usb autosuspend = enabled
tlp usb blacklist = (not configured)

Bus 001 Device 002 ID 8087:0024 control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. Integrated Rate Matching Hub (hub)
Bus 002 Device 002 ID 8087:0024 control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. Integrated Rate Matching Hub (hub)
Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 2000 -- Linux Foundation 2.0 root hub (hub)
Bus 002 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 2000 -- Linux Foundation 2.0 root hub (hub)
Bus 003 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 2000 -- Linux Foundation 2.0 root hub (hub)
Bus 004 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 2000 -- Linux Foundation 3.0 root hub (hub)
Bus 001 Device 003 ID 8087:07da control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb)
Bus 002 Device 003 ID 0424:b832 control = on, autosuspend_delay_ms = 2000 -- Standard Microsystems Corp. (snd-usb-audio, usbhid)
Bus 002 Device 004 ID 10f1:1a37 control = auto, autosuspend_delay_ms = 2000 -- Importek (uvcvideo)
HP ENVY 15
•3rd generation Intel(R) Core(TheeMahn) i5-3210M Processor (2.5 GHz with Turbo Boost up to 3.1 GHz)
• 1GB Radeon(TheeMahn) HD 7750M GDDR5 Graphics [HDMI]
• 6GB 1600DDR3 System Memory (2 Dimm)
• 750GB 7200 rpm Hard Drive
• Intel 2x2 802.11a/b/g/n WLAN + Bluetooth(R)
• Full-size Radiance backlit keyboard.

Image
User avatar
tanmay.01
Moderator
 
Posts: 253
Joined: Wed Dec 07, 2011 1:03 pm
Location: India
Age: 27
Operating System: Other Linux

Return to Software

Who is online

Users browsing this forum: No registered users and 2 guests