26

I am really really confused about the power management tools available for Linux: I have Arch Linux with XFCE on my laptop.

The guides on the the Arch Linux wiki list

  • acpi
  • acpid
  • pm-utils
  • cpufreq
  • laptop-mode-tools

to manage power, suspension, disks and CPU, WiFi, etc.

But I can't understand what the relationships between them are. Apparently they don't require each other (dependencies are listed as optional) but it's not clear to me what this implies: do they work together doing different things or are they alternative to each others or conflict with each other or what?


At the moment I only have pm-utils (+upower) installed. Do I also need acpi and/or acpid? And what about laptop-mode-tools: is this kind of supervisor of all the other tools? If so, should I configure only laptop-mode-tools or also each of the other tools separately? How do they interact with lm-sensors and cpufreq?

In addition to this, there is XFCE Power Manager, which seems to be unrelated to any of the above tools, as it works even if they are not installed. So my question is again, if I install the others will they conflict with XFCE Power Manager? And what about the power management options included in Xscreensaver? Do they conflict or do they override the settings in XFCE Power Manager (or acpi or pm-utils)?

All I want to do really is to have an efficient use of energy:

  • be able to go to standby/suspension
  • don't have the fan running all the time
  • don't overheat/damage the CPU and the hard drive
  • turn off WiFi when in standby/suspension
  • et cetera
slhck
  • 235,242
point618
  • 475

1 Answers1

31

ACPI:

  • acpi is a small command-line tool that displays basic ACPI information (mainly battery charge).

  • acpid is a daemon that handles various ACPI events – mostly power button, lid, battery and related stuff. For example, if the power button was pressed, acpid runs shutdown. When AC power is connected, acpid can run the apropriate laptop-mode-tools command.

    If you use systemd, then its systemd-logind replaces most of acpid's functionality (i.e. lid and power-button handling), although you can still use acpid for custom handling.

  • systemd-logind primarily deals with tracking user logon sessions and "seats", but it also handles some essential ACPI events (power button, lid close) as a more-integrated replacement for acpid.

CPU and power profiles:

  • cpufreq (superseded) and cpupower (its replacement) are command-line tools for adjusting CPU frequency scaling. (The actual functionality is part of the kernel and accessible through /sys; the cpupower command is for user convenience.)

  • cpufreqd (with the d) was an user-space daemon that can be used as a replacement for the default kernel-space governors (powersave, ondemand, performance). It is very rarely used – the standard governors are usually better (especially the later addition of the 'schedutil' governor which is more aware of system load).

  • laptop-mode-tools does various system adjustments whenever you plug or unplug AC power to your laptop – for example, disk spin-down times or switching cpufreq governors. It is run by acpid on 'AC' events to switch all those settings between "AC mode" and "battery mode".

laptop-mode-tools is somewhat outdated; some of its tweaks are useful, some others (e.g. disabling Ethernet autonegotiation) are just silly.

  • power-profiles-daemon provides an unified interface for switching between "performance, balanced, powersave" profiles that modern systems have built-in, to be used by desktop environments like GNOME (although it also has a command-line "powerprofilesctl" tool).

    Unlike e.g. the older laptop-mode-tools which twiddled many different knobs, power-profiles-daemon works entirely by changing just one or two platform-provided settings and letting your system firmware handle everything else.

  • thermald is a service that maintains CPU temperature, adjusting both CPU frequency and cooling according to a predefined profile. It is optional (the system firmware already does the same to an extent) but sometimes does a better job than the firmware at keeping a laptop cool.

    I believe thermald is specifically for Intel CPUs (i.e. not AMD), as it seems to work primarily with intel_pstate and have the ability to generate the profiles from Intel CPU-provided data. It also won't run specifically on ThinkPads.

Suspend:

  • pm-utils used to be a collection of tools to handle the preparations of suspending to memory and/or disk (running pre-suspend hooks, choosing the best method), e.g. you would run pm-suspend to put the machine to sleep.

    In the past you used to need pm-utils to cleanly suspend the machine, but these days pm-utils does very little as it can just tell the kernel to suspend without doing much else (specifically, it no longer needs to "manually" suspend the GPU via its VBIOS).

    pm-utils also comes with a pm-powersave command which is a lot like the aforementioned laptop-mode-tools, and would be called by upower to twiddle various knobs whenever you plug/unplug AC power.

  • systemd-logind also provides D-Bus functions for suspending/hibernating which other programs can call, in addition to the aforementioned ACPI event handling. In most cases, it completely supersedes pm-utils.

Other

  • upower is an abstraction layer for desktop applications to various power parameters. Programs can use it to check battery status, adjust backlight, or suspend the system without having to care about the specific platform.

    upower also uses PolicyKit to allow various actions (suspend, etc) without giving away full root privileges. It relies on pm-utils and acpid. GNOME and Xfce require upower for their "power management" settings.

  • Xfce Power Manager controls such parameters as display poweroff time, CPU scaling, LCD brightness, ACPI events... (The function are similar to acpid and laptop-mode-tools, which both only have one system-wide configuration, while XfPM allows per-user settings.) XfPM only manages the policy, but relies on upower for the actual mechanisms. Also, XfPM sends out[citation needed] such notifications as "Low battery".

grawity
  • 501,077