- Complete installation and uninstallation scripts - Optimized TLP configuration for maximum battery life - PowerTOP analysis and auto-tune functionality - Real-time battery monitoring with detailed stats - ThinkPad-specific optimizations and battery thresholds - Comprehensive documentation and usage guides - Tested on ThinkPad T14 Gen 1 with 13% power reduction
6.0 KiB
6.0 KiB
TLP Configuration Guide
Overview
TLP (Linux Advanced Power Management) is a feature-rich command line utility for optimizing battery life on Linux laptops. This guide explains the key configuration options and their impact on battery performance.
Configuration File Location
The main configuration file is located at:
/etc/tlp.conf(system-wide configuration)- Backup copies are created as
/etc/tlp.conf.backup.YYYYMMDD_HHMMSS
Key Configuration Sections
1. Operation Modes
# Default operation mode
TLP_DEFAULT_MODE=BAT
# Use persistent mode for consistent behavior
TLP_PERSISTENT_DEFAULT=0
Explanation:
BAT: Optimizes for battery lifeAC: Optimizes for AC power (performance)DEF: Uses kernel defaults
2. CPU Power Management
# CPU frequency governor
CPU_SCALING_GOVERNOR_ON_AC=powersave
CPU_SCALING_GOVERNOR_ON_BAT=powersave
# CPU frequency limits
CPU_SCALING_MIN_FREQ_ON_BAT=800000
CPU_SCALING_MAX_FREQ_ON_BAT=1600000
# Intel P-state settings
CPU_HWP_ON_BAT=power
CPU_MAX_PERF_ON_BAT=50
CPU_BOOST_ON_BAT=0
Impact:
- Reduces CPU power consumption by 20-40%
- May slightly reduce performance under heavy loads
- Automatic scaling based on demand
3. Disk Power Management
# Advanced Power Management levels
DISK_APM_LEVEL_ON_BAT="128 128"
# IO scheduler optimization
DISK_IOSCHED="mq-deadline mq-deadline"
# AHCI Link Power Management
AHCI_ALPM_ON_BAT=min_power
Impact:
- Reduces disk power consumption
- May increase disk access latency slightly
- Significant savings for HDDs, moderate for SSDs
4. Graphics Power Management
# Radeon settings (for AMD GPUs)
RADEON_POWER_PROFILE_ON_BAT=low
RADEON_DPM_STATE_ON_BAT=battery
# Intel graphics automatically managed
Impact:
- Reduces GPU power consumption by 15-30%
- Lower graphics performance in games/3D applications
- Minimal impact on desktop usage
5. Wireless Device Management
# WiFi power saving
WIFI_PWR_ON_BAT=on
# Bluetooth management
DEVICES_TO_DISABLE_ON_BAT="bluetooth"
# Wake on LAN
WOL_DISABLE=Y
Impact:
- Reduces wireless power consumption
- May affect network performance slightly
- Automatic reconnection when needed
6. USB Power Management
# Enable USB autosuspend
USB_AUTOSUSPEND=1
# Exclude critical devices
USB_BLACKLIST_PRINTER=1
USB_BLACKLIST_PHONE=0
Impact:
- Suspends unused USB devices
- Saves 0.5-2W per device
- Blacklist prevents issues with specific devices
7. Battery Charge Thresholds (ThinkPad)
# Start charging at 75%
START_CHARGE_THRESH_BAT0=75
# Stop charging at 80%
STOP_CHARGE_THRESH_BAT0=80
Impact:
- Extends battery lifespan significantly
- Reduces available capacity slightly
- Optimal for plugged-in usage
Advanced Optimizations
CPU Undervolting
For advanced users, CPU undervolting can provide additional power savings:
# EXPERIMENTAL - Use with caution
# PHC_CONTROLS="F:V F:V F:V F:V"
Warning: Only use if you understand the risks. Incorrect values can cause system instability.
Custom Scripts
You can add custom power management commands to:
/etc/tlp.d/- Additional configuration files- Systemd services for startup optimizations
Monitoring Configuration Impact
Check Current Settings
# Show all TLP settings
sudo tlp-stat
# Show specific components
sudo tlp-stat -p # Processor
sudo tlp-stat -d # Disks
sudo tlp-stat -g # Graphics
sudo tlp-stat -u # USB
Measure Power Consumption
# Before configuration changes
sudo powertop --time=60
# Apply changes
sudo tlp start
# After configuration changes
sudo powertop --time=60
Distribution-Specific Notes
Ubuntu/Debian
- Install with:
sudo apt install tlp tlp-rdw - May conflict with
power-profiles-daemon
Fedora/RHEL
- Install with:
sudo dnf install tlp tlp-rdw - Disable conflicting services
Arch Linux
- Install with:
sudo pacman -S tlp - Enable service:
sudo systemctl enable tlp.service
Laptop-Specific Optimizations
ThinkPad
- Install additional tools:
tp-smapi-dkms acpi-call-dkms - Battery threshold support available
- Enhanced fan control
Dell
- Use
i8kutilsfor fan control - BIOS settings may override some options
HP
- Limited hardware support
- Focus on software optimizations
Troubleshooting
Common Issues
-
TLP not applying settings
sudo systemctl enable tlp.service sudo systemctl start tlp.service -
Settings reset after reboot
- Check if other power managers are active
- Ensure TLP service is enabled
-
USB devices not working
- Add device IDs to blacklist
- Check
lsusboutput for device identification
Verification Commands
# Check TLP service status
systemctl status tlp.service
# Verify configuration syntax
sudo tlp-stat -c
# Test specific settings
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Performance vs Battery Life
Maximum Battery Life Profile
- All power saving features enabled
- Significant performance reduction acceptable
- Target: 30-50% longer battery life
Balanced Profile
- Moderate power saving
- Minimal performance impact
- Target: 15-25% longer battery life
Performance Profile
- Limited power saving
- Maximum performance preserved
- Target: 5-10% longer battery life
Regular Maintenance
Monthly Tasks
- Review power consumption reports
- Check battery health
- Update TLP configuration if needed
After System Updates
- Verify TLP service is still running
- Check for configuration file changes
- Test critical functionality
Best Practices
- Start Conservative: Begin with moderate settings and adjust gradually
- Monitor Impact: Use PowerTOP to measure actual improvements
- Document Changes: Keep track of modifications for troubleshooting
- Test Thoroughly: Verify all hardware functions correctly
- Regular Updates: Keep TLP and related tools current
This configuration guide should be used alongside the main installation and monitoring tools provided in this repository.