Changes to `/etc/default/tlp`

There are two potential changes to /etc/default/tlp I'd like to discuss.

Considerations

tlp is a community package so would need either an upstream change or for us to add it to the overlay packages.

USB_AUTOSUSPEND

Currently, this is set to 1, which can force USB devices to suspend even if their drivers do not support that behaviour.

When set to 0, device drivers that support suspend will suspend their device anyway.

Having this set to 1 causes issues, e.g.:

and (abridged) discussion on IRC:

<OMGitsFlauschig> Hey guys, I've got a new Seagate expansion 2TB external harddrive, but it isn't even listed by "fdisk -l". According to the "dmseg" output it seems to connect, but the "lsusb -v" says the device couldn't be opened. Any idea how to solve this problem?
<OMGitsFlauschig> I don't have my Windows machine with me right now, so that will have to wait. It isn't listed in Gparted either. The drive always seems to start up first, but then stops again
<OMGitsFlauschig> Well, it looks like it works on a Windows laptop just fine. Are Seagate Drives not compatible with Linux? Is there any encryptions or power saving modes that interfere with it?
<jonathon> just to check, can you edit /etc/default/tlp and set USB_AUTOSUSPEND=0 ? You might need a reboot for it to take effect
<OMGitsFlauschig> I'm using Thunar. It looks like the USB_AUTOSUSPEND is on 1. I'll change that, let's see if it works then
<OMGitsFlauschig> The USB_AUTOSUSPEND variable was actually the problem, now it works. Thanks a lot, have a nice day

I've also had it cause havoc on USB disk drives (e.g. repeated forced power-down), as well as issues with USB DACs.

RADEON_POWER_PROFILE_ON_AC

The current Radeon profiles force high and low power on AC and battery. For AC use this can cause excessive power use and heat generation, akin to running your CPU at a constant 100%.

Setting this to RADEON_POWER_PROFILE_ON_AC=default means the GPU detects usage and scales frequencies accordingly. This reduces power consumption considerably, and therefore reduces heat. There's no reason I can see for constantly running GPUs at full frequency.

7 Likes

There is also this:

https://wiki.archlinux.org/index.php/TLP#Btrfs

Currently, manjaro-architect checks for btrfs and sets this setting accordingly, but we could also set it with a overlay package. That way also calamares users would benefit. I suspect that non-trivial amount of negative btrfs experiences on manjaro may have been caused by this.

Yeah, that's pretty critical... :face_vomiting:

Though I think I looked into that before and the issue was for a specific piece of hardware operating in a specific circumstance...

I'm preparing a TLP package which changes five of the default settings. @Manjaro-Team Unless anyone has any objections I'll push this into unstable for testing.

PKGBUILD
# $Id$
# Maintainer: Jonathon Fernyhough <jonathon manjaro_dot_org>
# Contributor: Maxime Gauduin <alucryd archlinux.org>
# Contributor: Marc Schulte <bomba nerdstube.de>

pkgbase=tlp
pkgname=('tlp' 'tlp-rdw')
pkgver=1.0
pkgrel=1.1
arch=('any')
url='http://linrunner.de/en/tlp/tlp.html'
license=('GPL2' 'GPL3')
source=("tlp-${pkgver}.tar.gz::https://github.com/linrunner/TLP/archive/${pkgver}.tar.gz")
sha256sums=('642717b27db3a70c2cdef2673fe3229bf314488aa0797515e63d933b93bc78ec')

prepare() {
  cd ${pkgbase^^}-${pkgver}

  ###
  # These changes represent feedback gathered over time from Manjaro users and
  # should prevent "hidden" issues with USB devices and performance issues
  # with SSDs.
  #
  # They also enable some power saving on AC power as there's no real need to
  # run things constantly at full power just because you're not on battery.
  #
  # Anyone looking for further power savings can easily alter these settings
  # after installation.

  # Be less aggressive with SATA ALPM to prevent poor SSD performance and
  # potential data corruption.
  sed -i '126s/=min_power/=medium_power/' default

  # Use hardware defaults for open-source AMD drivers.
  # This allows demand-based power scaling and vastly reduces heat generation.
  sed -i '149s/=high/=default/' default

  # Enable audio power saving on AC power.
  sed -i '170s/=0/=1/' default

  # Enable runtime power management for PCI(e) on AC power.
  sed -i '186s/=on/=auto/' default

  # Disable aggressive USB device autosuspend.
  # This prevents "hidden" issues with USB hardware that is incompatible.
  sed -i '200s/enable/enable aggressive/; 201s/=1/=0/' default

  ###
}

package_tlp() {
  pkgdesc='Linux Advanced Power Management'
  depends=('hdparm' 'iw' 'pciutils' 'rfkill' 'usbutils' 'util-linux')
  optdepends=('acpi_call: ThinkPad battery functions, Sandy Bridge and newer'
              'bash-completion: Bash completion'
              'ethtool: Disable Wake On Lan'
              'lsb-release: Display LSB release version in tlp-stat'
              'smartmontools: Display S.M.A.R.T. data in tlp-stat'
              'tp_smapi: ThinkPad battery functions'
              'x86_energy_perf_policy: Set energy versus performance policy on x86 processors')
  conflicts=('laptop-mode-tools' 'pm-utils')
  backup=('etc/default/tlp')

  cd TLP-${pkgver}

  export TLP_SBIN='/usr/bin'
  export TLP_ULIB='/usr/lib/udev'
  export TLP_SYSD='/usr/lib/systemd/system'
  export TLP_NO_INIT='1'
  export TLP_NO_PMUTILS='1'
  export TLP_WITH_SYSTEMD='1'

  make DESTDIR="${pkgdir}" install-tlp install-man
}

package_tlp-rdw() {
  pkgdesc='Linux Advanced Power Management - Radio Device Wizard'
  depends=('networkmanager' 'tlp')

  cd TLP-${pkgver}

  make DESTDIR="${pkgdir}" install-rdw
}

# vim: ts=2 sw=2 et:

SATA_LINKPWR_ON_BAT=min_power => medium_power

Be less aggressive with SATA ALPM to prevent poor SSD performance and potential data corruption.

RADEON_POWER_PROFILE_ON_AC=high => default

Use hardware defaults for open-source AMD drivers. This allows demand-based power scaling and vastly reduces heat generation.

SOUND_POWER_SAVE_ON_AC=0 => 1

Enable audio power saving on AC power. We don't need to run things constantly at full power.

RUNTIME_PM_ON_AC=on => auto

Enable runtime power management for PCI(e) on AC power. We don't need to run things constantly at full power.

USB_AUTOSUSPEND=1 => 0

Disable aggressive USB device autosuspend. This prevents "hidden" issues with USB hardware that is incompatible.

Note: this may increase power usage - it remains to be seen what effect it will have. IMHO better compatibility with devices (and fewer random issues) is worth it as a default.


4 Likes

Many thanks, @jonathon!

Seems legit.

@jonathon: latest tlp v1.0-1.4 is not in our git-repo. Also we should revert the powersavings for sound. It might create issues with unneeded noize with some chip-sets.

@jonathon please consider also to check in iso-profiles repo the tlp configurations since i see a tlp conf file and this override your default settings...

@Ste74: point me to it. I assume only for the live-session but not for the installed system.

Huh... I thought I'd pushed that - but I have now.

The changes to the upstream defaults in 1.0-1.4 are:

  # Be conservative with SATA ALPM to prevent poor SSD performance and
  # potential data corruption; makes little difference in normal system usage.
  sed -i '126s/=min_power/=max_performance/' default

  # Use hardware defaults for open-source AMD drivers.
  # This allows demand-based power scaling and vastly reduces heat generation.
  sed -i '149s/=high/=default/' default

  # Disable aggressive USB device autosuspend.
  # This prevents "hidden" issues with USB hardware that is incompatible.
  sed -i '200s/enable/enable aggressive/; 201s/=1/=0/' default

Yep


Only to be sure if this config is always ok

Forum kindly sponsored by