power-profiles-daemon package conflicts with TLP

Bug #1934944 reported by Mustapha Hadid
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
High
Bin Li
tlp (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

THE PROBLEM:

The new power-profiles-daemon package (installed by default in Ubuntu 21.04) comes with a systemd unit power-profiles-daemon.service. This unit declares a conflict with tlp.service causing tlp.service to be effectively disabled.

/lib/systemd/system/power-profiles-daemon.service (notice the Conflicts= directive)
--------------
[Unit]
Description=Power Profiles daemon
Conflicts=tuned.service tlp.service auto-cpufreq.service
Before=multi-user.target display-manager.target

...
--------------

If a unit has a Conflicts= directive on another unit, starting the former will stop the latter and vice versa. And because tlp.service doesn't declare Conflicts= directive on power-profiles-daemon.service, it will always be the one that gets disabled during system startup regardless of the activation order of the units.

An issue has been reported to the project maintainer regarding this [1].

EXPECTED BEHAVIOUR:

TLP package is not installed by default. Installing TLP package explicitly should make it the active power management agent in the system. Any other power management agents installed in the system should be effectively disabled including Power Profiles daemon.

ACTUAL BEHAVIOUR:

Even after installing TLP package explicitly. The power-profiles-daemon.service unit will remain the active service causing tlp.service to be effectively disabled. Although tlp.service unit is disabled, a change in the power source will make TLP apply the desired settings. This is the case because tlp.service is only responsible for applying the TLP settings at boot [2][3].

PROPOSED SOLUTION:

TLP service unit may include Conflicts=power-profiles-daemon.service directive. This will resolve the issue in the current setup of both services, as tlp.service is activated before power-profiles-daemon.service.

Also, configuring TLP service unit with Before=power-profiles-daemon.service will make tlp.service activation always takes precedence over power-profiles-daemon.service.

REFERENCES:

[1] https://github.com/linrunner/TLP/issues/564
[2] https://linrunner.de/tlp/introduction.html#how-it-works
[3] https://linrunner.de/tlp/developers/architecture.html

ProblemType: Bug
DistroRelease: Ubuntu 21.04
Package: tlp 1.3.1-2
ProcVersionSignature: Ubuntu 5.11.0-22.23-generic 5.11.21
Uname: Linux 5.11.0-22-generic x86_64
ApportVersion: 2.20.11-0ubuntu65.1
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Thu Jul 8 01:26:37 2021
InstallationDate: Installed on 2020-03-14 (480 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Alpha amd64 (20200309)
PackageArchitecture: all
SourcePackage: tlp
UpgradeStatus: Upgraded to hirsute on 2021-06-03 (34 days ago)

Revision history for this message
Mustapha Hadid (mhadidg) wrote :
description: updated
description: updated
description: updated
Mustapha Hadid (mhadidg)
description: updated
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in tlp (Ubuntu):
status: New → Confirmed
Alex Tu (alextu)
tags: added: oem-priority
Rex Tsai (chihchun)
Changed in oem-priority:
importance: Undecided → High
Bin Li (binli)
Changed in oem-priority:
assignee: nobody → Bin Li (binli)
status: New → Triaged
Revision history for this message
Marco van Zwetselaar (zwets) wrote :

Well spotted and diagnosed by the initial bug reporter, and many thanks to the maintainers working on this.

Just to make this bug report more easy to find, as its title doesn't give this away: the TLP service fails to start on Ubuntu Hirsute 21.04 due to issue #1934944.

Revision history for this message
Bin Li (binli) wrote :

power-profiles-daemon, it will handle below sys path. And in CPUFREQ_POLICY_DIR it will use 'energy_performance_preference'.

ACPI_PLATFORM_PROFILE_PATH "/sys/firmware/acpi/platform_profile"
ACPI_PLATFORM_PROFILE_CHOICES_PATH "/sys/firmware/acpi/platform_profile_choices"
CPUFREQ_POLICY_DIR "/sys/devices/system/cpu/cpufreq/"
NO_TURBO_PATH "/sys/devices/system/cpu/intel_pstate/no_turbo"

$ grep ppd_utils_get_sysfs_path * -rn
src/ppd-driver-platform-profile.c:102: platform_profile_path = ppd_utils_get_sysfs_path (ACPI_PLATFORM_PROFILE_PATH);
src/ppd-driver-platform-profile.c:125: platform_profile_choices_path = ppd_utils_get_sysfs_path (ACPI_PLATFORM_PROFILE_CHOICES_PATH);
src/ppd-driver-platform-profile.c:233: platform_profile_path = ppd_utils_get_sysfs_path (ACPI_PLATFORM_PROFILE_PATH);
src/ppd-driver-platform-profile.c:270: platform_profile_path = ppd_utils_get_sysfs_path (ACPI_PLATFORM_PROFILE_PATH);
src/ppd-utils.h:15:char * ppd_utils_get_sysfs_path (const char *filename);
src/ppd-utils.c:16:ppd_utils_get_sysfs_path (const char *filename)
src/ppd-driver-intel-pstate.c:104: dir = ppd_utils_get_sysfs_path (CPUFREQ_POLICY_DIR);
src/ppd-driver-intel-pstate.c:123: policy_dir = ppd_utils_get_sysfs_path (CPUFREQ_POLICY_DIR);
src/ppd-driver-intel-pstate.c:142: pstate->no_turbo_path = ppd_utils_get_sysfs_path (NO_TURBO_PATH);

Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tlp - 1.4.0-1

---------------
tlp (1.4.0-1) unstable; urgency=medium

  * [f3a319c] New upstream version 1.4.0 (LP: #1923737)

  [ Thomas Koch ]
  * [bc613b8] Remove dependency on lsb-base
  * [babd6e5] Update package description
  * [559264f] Bump debhelper compatibility level to 12
  * [3e89fce] Mask/unmask power-profiles-daemon.service (LP: #1934944)

  [ Raphaël Halimi ]
  * [0d4086f] Remove '-guest' from Vcs-* URLs
  * [ec2fce9] debian/watch: update to version 4
  * [2686afe] Drop unused lintian overrides:
      - testsuite-autopkgtest-missing
      - manpage-without-executable
  * [7448f28] Bump Standards-Version to 4.6.0
  * [866222a] debian/copyright: update copyright years

 -- Raphaël Halimi <email address hidden> Mon, 27 Sep 2021 18:05:42 +0200

Changed in tlp (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Bin Li (binli) wrote :

Reported a bug last week, and the maintainer didn't like to have a compatible way. :(

https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/issues/54

Revision history for this message
Bin Li (binli) wrote :

After upgraded the power-profiles-daemon, the service will be enable again.

Changed in oem-priority:
status: Triaged → Fix Released
assignee: Bin Li (binli) → nobody
Revision history for this message
Bin Li (binli) wrote :

Cause this issue is fixed in tlp, I will open a new bug to handle tlp and power-profiles-daemon.

Changed in oem-priority:
assignee: nobody → Bin Li (binli)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.