Optimized power settings

From Manjaro Linux
Jump to: navigation, search
Warning: This is archived wiki article and it is deprecated.
PLEASE FOLLOW POWER SAVINGS SETUP FROM THIS LINK


Take control of the energy consumption in Manjaro

Certain settings need to be done to optimize the power savings. Valid entries in the GRUB configuration file activates Intel's advanced energy saving, higher performance and correct operation of ACPI. Anyone who has an Intel processor should install the daemon Thermald. Deamon Thermald dynamically manages CPU cooling: cooler, quieter. After installing the kernel 3.14.x, users of AMD Radeon GPUs have access to DPM. Quieter, cooler and more efficient. TLP replaces laptop-tools. More control over the configuration of power saving is gained.

Important things

  • Make sure that you have installed 3.14.x kernel
  • Make sure that you have installed for your CPU Microcode
  • Make sure that you have added the appropriate entries in the GRUB configuration file
  • Make sure you have installed all of the updates

Installing Linux kernel 3.14.x

In a terminal, run the following command:

sudo mhwd-kernel -i linux314

Installing Intel Microcode

In a terminal, run the following command (if Microcode is not installed):

sudo pacman -Syu intel-ucode
Warning: Since intel-ucode 20140913-1 microcode need early loading during boot process. Please read following ArchWiki guide and proper setup GRUB.

Adding advanced flags to the GRUB configuration file

Make backup a default grub file:

sudo cp /etc/default/grub /etc/default/grub.bak

Edit grub file in Your favorite text editor. For this HowTo I used gedit.

sudo gedit /etc/default/grub

Find line:


GRUB_CMDLINE_LINUX=""


Paste the appropriate flags between the quotation marks as described below.

For more information on what these flags do, please read The Arch Wiki.

The story of _OSI(Linux)

From pre-history through Linux-2.6.22, Linux responded TRUE upon a BIOS OSI(Linux) query. Unfortunately, reference BIOS writers got wind of this and put OSI(Linux) in their example code, quickly exposing this string as ill-conceived and opening the door to an un-bounded number of BIOS incompatibilities. For example, OSI(Linux) was used on resume to re-POST a video card on one system, because Linux at that time could not do a speedy restore in its native driver. But then upon gaining quick native restore capability, Linux has no way to tell the BIOS to skip the time-consuming POST -- putting Linux at a permanent performance disadvantage. On another system, the BIOS writer used OSI(Linux) to infer native OS support for IPMI! On other systems, OSI(Linux) simply got in the way of Linux claiming to be compatible with other operating systems, exposing BIOS issues such as skipped device initialization.

So "Linux" turned out to be a really poor chose of OSI string, and from Linux-2.6.23 onward we respond FALSE.

BIOS writers should NOT query _OSI(Linux) on future systems. Linux will complain on the console when it sees it, and return FALSE. To get Linux to return TRUE for your system will require a kernel source update to add a DMI entry, or boot with "acpi_osi=Linux".

Source

GRUB Flags

  • INTEL - standard (Linux 3.14.x or older)

acpi_osi=Linux acpi=force acpi_enforce_resources=lax i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 i915.semaphores=1



  • INTEL - when not working backlight control function keys (Linux 3.14.x or older)

acpi_osi=Linux acpi=force acpi_enforce_resources=lax i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 i915.semaphores=1 drm.vblankoffdelay=1 acpi_backlight=vendor



  • INTEL - standard (Linux 3.15.x or newer)

acpi_osi=Linux acpi=force acpi_enforce_resources=lax i915.enable_rc6=1 i915.enable_fbc=1 i915.lvds_downclock=1 i915.semaphores=1



  • INTEL - when not working backlight control function keys (Linux 3.15.x or newer)

acpi_osi=Linux acpi=force acpi_enforce_resources=lax i915.enable_rc6=1 i915.enable_fbc=1 i915.lvds_downclock=1 i915.semaphores=1 drm.vblankoffdelay=1 acpi_backlight=vendor



  • AMD/NVIDIA - standard

acpi_osi=Linux acpi=force acpi_enforce_resources=lax



  • AMD/NVIDIA - when not working backlight control function keys

acpi_osi=Linux acpi=force acpi_enforce_resources=lax drm.vblankoffdelay=1 acpi_backlight=vendor



  • ACPI - for the modern models of laptops with UEFI (2011 year production or newer) please adding beside acpi_osi=Linux:

acpi_osi='!Windows 2012'



  • AMD - enable DPM for the graphics cards AMD Radeon. Flag Only for Open Source Drivers. (Linux 3.11.x or newer)

radeon.dpm=1



  • AMD - enable HDMI Audio for the graphics cards AMD Radeon. Flag Only for Open Source Drivers.

radeon.audio=1



  • Enable ASPM even on devices that claim not to support it (optional):

pcie_aspm=force


Warning: Forcing ASPM on may cause system lockups.

You can check ASPM status by commands:

sudo lspci -vv | grep ASPM.*abled\;
dmesg |grep ASPM
cat /sys/module/pcie_aspm/parameters/policy

Safe is using default BIOS settings of ASPM.

  • Disable system sleep the USB ports (optional)

usbcore.autosuspend=-1


Save changes to a file. Execute the command in a terminal:

sudo update-grub

Disable sub menus in GRUB

To disable sub menus on your end please add the following line:


GRUB_DISABLE_SUBMENU=y


Save changes to a file. Execute the command in a terminal:

sudo update-grub

Installing TLP

In a terminal, run the following command:

sudo pacman -S tlp iw smartmontools --noconfirm --needed

Setup TLP

note: Customizing TLP conf file is OPTIONAL. Default setup TLP is safe for all, but if You want control custom settings read documentation and make proper changes.

Make a backup default tlp file:

sudo cp /etc/default/tlp /etc/default/tlp.bak

Edit tlp file:

sudo gedit /etc/default/tlp

Only for Intel CPUs with P-state Set values for max performance on AC:


CPU_SCALING_GOVERNOR_ON_AC=performance
CPU_SCALING_GOVERNOR_ON_BAT=powersave


or if You preffer lower temperatures instead performance:


CPU_SCALING_GOVERNOR_ON_AC=powersave
CPU_SCALING_GOVERNOR_ON_BAT=powersave


Optional: allow (1) or deny (0) Turbo Mode on AC/BAT:


CPU_BOOST_ON_AC=1
CPU_BOOST_ON_BAT=0


Optional: Disable spin down disk on BAT:


DISK_APM_LEVEL_ON_AC="254 254"
DISK_APM_LEVEL_ON_BAT="254 254"


Save changes to a file.

If You skipped customizing TLP setup just launch tlp services by command:

sudo systemctl enable tlp-sleep.service && sudo systemctl enable tlp && sudo systemctl start tlp
note: Before edit /etc/default/tlp file stop daemon tlp sudo systemctl stop tlp After save changes in a file start daeamon tlp sudo systemctl start tlp

Installing Linux Thermal Daemon (only for Intel CPUs)

note: Before install thermald please install and configure propertly lm_sensors by command sudo pacman -S lm_sensors && sudo sensors-detect

Install, enable and run thermald daemon by following command:

sudo pacman -S thermald --noconfirm --needed && sudo systemctl enable thermald.service && sudo systemctl start thermald.service

Dynamically changing the scheduler I/O disks

The default I/O scheduler in Manjaro is BFQ . Higher read/write performance for the solid state drives have scheduler noop. You can automate the process of change scheduler disk I/O, depending on whether the disk is rotating (HDD) or not (SSD). Create a new file:

sudo gedit /etc/udev/rules.d/60-schedulers.rules

Paste this code into it:


# set noop scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="noop"
# set bfq scheduler for rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq"


Save changes to a file. Restart the computer.

You can check current using scheduler for all connected disks by command:

cat /sys/block/sd*/queue/scheduler

Summary

Default power settings (based on laptop-tools give high CPU temperature (52-56 °C idle and 65-70 °C under high usage). After applying the appropriate entries in the GRUB configuration file after installing the TLP and Linux Thermal Daemon (thermald), I got a low power consumption of battery time (around 9 W), low CPU temperature (45-48 °C idle and 56 °C under high usage) and higher performance at work on AC power.

I encourage you to read the documentation TLP. You can customize the service to suit your needs. This topic contains the basic configuration to work properly.

Support

Official forum topic: [1]

See Also

TLP Homepage

Arch Wiki: TLP

Arch Wiki: SSD I/O Scheduler

Linux Thermal Daemon

Linux Kernel Parameters