Arch Linux Power Management - ryzendew/Linux-Tips-and-Tricks GitHub Wiki

Arch Linux Power Management Guide

Complete beginner-friendly guide to power management on Arch Linux, including laptop battery optimization, CPU frequency scaling, power saving, and TLP configuration.


Table of Contents

  1. CPU Frequency Scaling
  2. Laptop Power Management
  3. TLP Configuration
  4. Suspend and Hibernate
  5. Power Monitoring
  6. Troubleshooting

CPU Frequency Scaling

Install cpupower

Install tools:

# Install cpupower
sudo pacman -S cpupower

# Check current governor
cpupower frequency-info

CPU Governors

Available governors:

  • performance: Maximum performance
  • powersave: Maximum power saving
  • ondemand: Dynamic scaling
  • conservative: Gradual scaling
  • schedutil: Scheduler-based

Set Governor

Change governor:

# Set performance
sudo cpupower frequency-set -g performance

# Set powersave
sudo cpupower frequency-set -g powersave

# Set ondemand
sudo cpupower frequency-set -g ondemand

Enable at Boot

Persist settings:

# Create service
sudo systemctl enable cpupower.service

# Or use systemd
sudo systemctl enable cpupower

Laptop Power Management

Install TLP

Install TLP:

# Install TLP
sudo pacman -S tlp tlp-rdw

# Enable service
sudo systemctl enable tlp
sudo systemctl start tlp

TLP Configuration

Configure TLP:

# Edit config
sudo vim /etc/tlp.conf

Common settings:

# CPU scaling
CPU_SCALING_GOVERNOR_ON_AC=performance
CPU_SCALING_GOVERNOR_ON_BAT=powersave

# CPU frequency
CPU_MAX_PERF_ON_AC=100
CPU_MAX_PERF_ON_BAT=50

# GPU
RUNTIME_PM_ON_AC=on
RUNTIME_PM_ON_BAT=auto

Apply TLP Settings

Apply changes:

# Apply settings
sudo tlp start

# Check status
sudo tlp-stat -s

Battery Optimization

Battery Information

Check battery:

# Install tools
sudo pacman -S acpi

# Check battery
acpi -V

# Or
cat /sys/class/power_supply/BAT0/capacity

Battery Thresholds

Set charging thresholds:

# For ThinkPads
echo 80 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold

# Check current
cat /sys/class/power_supply/BAT0/charge_control_end_threshold

Suspend and Hibernate

Suspend

Suspend system:

# Suspend
systemctl suspend

# Or
sudo pm-suspend

Hibernate

Hibernate system:

# Hibernate
systemctl hibernate

# Or
sudo pm-hibernate

Configure Swap for Hibernate

Setup swap:

# Check swap
swapon --show

# Create swap file
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

# Add to fstab
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Power Monitoring

Power Statistics

Monitor power:

# Install powertop
sudo pacman -S powertop

# Run powertop
sudo powertop

# Generate report
sudo powertop --html=report.html

Battery Monitoring

Monitor battery:

# Install battery tools
sudo pacman -S upower

# Check battery
upower -i /org/freedesktop/UPower/devices/battery_BAT0

Troubleshooting

High Power Consumption

Optimize:

# Check processes
powertop

# Disable unnecessary services
sudo systemctl disable service-name

# Check GPU
nvidia-smi  # NVIDIA
radeontop   # AMD

Suspend Issues

Fix suspend:

# Check logs
journalctl -b | grep suspend

# Test suspend
systemctl suspend

# If issues, try:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Summary

This guide covered:

  1. CPU scaling - Frequency governors
  2. Laptop power - TLP configuration
  3. Battery - Optimization
  4. Suspend/hibernate - Power states
  5. Monitoring - Power statistics
  6. Troubleshooting - Common issues

Key Takeaways:

  • Use TLP for laptops
  • Set appropriate CPU governor
  • Monitor power consumption
  • Configure suspend/hibernate
  • Optimize for battery life

Next Steps


This guide is based on the ArchWiki. For the most up-to-date information, always refer to the official ArchWiki.