Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

Power Saving improvements from Fedora 28

Post Reply
Message
Author
Alt
Forum Novice
Forum  Novice
Posts: 78
Joined: Wed Jan 27, 2016 1:28 am

Power Saving improvements from Fedora 28

#1 Post by Alt » Sat Jun 02, 2018 1:48 pm

improve_linux_laptop_battery_life.pdf, YT video
RedHat's developer Hans de Goede took initiative to improve Linux power usage.
Users of Fedora 28 now have better battery life out of the box

What was before:
- TLP which set (or rather tried to set) universal rules
- powertop which analyzed particular system and gave suggestions (or auto-tuned)

What was done for Fedora 28:
[*]1) Enabling autosuspend for USB Bluetooth (saves ±0.4W)
I don't know how to do that, probably some specific command from powertop

[*]2) Enabling autosuspend for Intel HDA codecs (saves ~ 0.4W)
I guess it's

Code: Select all

echo '1' > '/sys/module/snd_hda_intel/parameters/power_save';
[*]3) Enabling SATA link PM by default (saves 1 – 1.5W)
The most interesting part.
According to developer powertop's "min_power setting is known to cause disk corruption issues"
So for kernel 4.15+ we can use script

Code: Select all

for i in /sys/class/scsi_host/host*/link_power_management_policy; do
    echo med_power_with_dipm > $i
done
P.S. There was report about problems from SurfaceLinux user that he disabled this with boot parameter

Code: Select all

ahci.mobile_lpm_policy=0
But I doubt that Debian will enable it by default.

[*]4) Enabling i915 Panel Self Refresh by default
"Defaults to of because it is known to cause issues on a lot of devices"
If you still want to try first

Code: Select all

cat /sys/kernel/debug/dri/0/i915_edp_psr_status
If it doesn't return "PSR not supported" then add boot parameter into GRUB "i915.enable_psr=1"

Now let's do it!:

1) In Terminal

Code: Select all

sudo apt install -y powertop
Unplug power, run command bellow and wait for 5 minutes

Code: Select all

sudo powertop --calibrate --html
2)

Code: Select all

sudoedit /etc/rc.local
There must be at least 3 lines like

Code: Select all

#!/bin/sh -e

exit 0
3) Open powertop.html (probably on your home folder),
click on "Tuning"
Select-copy commands from "Script" collumn one by one with double click on the row
and paste those commands (each on the new line) before "exit" line

-----
I suggest not to use suspend your USB mouse (you will be annoyed by disconnects every few seconds)

Code: Select all

echo 'auto' > '/sys/bus/usb/devices/1-1/power/control';
Instead of

Code: Select all

echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy'
use script above

Think about

Code: Select all

echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';
as it may slow down your HDD performance and in case of failure there's small possibility that you will lost something (it increases timeout for data writing from default 5 sec to 15 sec)
-----

I hope there will be even more goodies in kernel 4.17.

Cheers.

User avatar
rich
Forum Regular
Forum Regular
Posts: 296
Joined: Sat Mar 31, 2018 6:39 pm

Re: Power Saving improvements from Fedora 28

#2 Post by rich » Wed Jun 06, 2018 12:22 am

This is cool! Have you done this on your system, have you noticed improvement?
MX 17.1 Dell Inspiron N5110

Alt
Forum Novice
Forum  Novice
Posts: 78
Joined: Wed Jan 27, 2016 1:28 am

Re: Power Saving improvements from Fedora 28

#3 Post by Alt » Sun Jun 17, 2018 2:48 pm

I didn't measure numbers but all those tweaks worked quiet nicely for me.

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16165
Joined: Fri Dec 15, 2006 8:07 pm

Re: Power Saving improvements from Fedora 28

#4 Post by Stevo » Sun Jun 17, 2018 3:51 pm

For Intel third generation and up processors, have you tried undervolting the CPU and integrated GPU (if turned on) with iuvolt? So far, undervolting the CPU and cache by 170mv and GPU by 120mv for the i7 8750H on the new laptop seems to be stable.

Alt
Forum Novice
Forum  Novice
Posts: 78
Joined: Wed Jan 27, 2016 1:28 am

Re: Power Saving improvements from Fedora 28

#5 Post by Alt » Mon Jun 18, 2018 1:34 pm

I didn't try because it requires intel_pstate which unfortunately is less effective for MuQSS than "ondemand" (one of the reasons it's excluded from Liquorix).

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16165
Joined: Fri Dec 15, 2006 8:07 pm

Re: Power Saving improvements from Fedora 28

#6 Post by Stevo » Mon Jun 18, 2018 2:18 pm

No, iuvolt does not require the p_state governor be running, just an third-gen Intel processor or above. I use it with both Debian-style and Liquorix kernels, and "sudo i7z" shows that Vcore does drop by the amount I specify. BTW, -170 mv caused a few lockups after some hours on my i7, so I backed off to -150 and it's been running fine with that.

Alt
Forum Novice
Forum  Novice
Posts: 78
Joined: Wed Jan 27, 2016 1:28 am

Re: Power Saving improvements from Fedora 28

#7 Post by Alt » Thu Jun 28, 2018 12:00 pm

Just checked config of Debian experimental 4.17.2. It has CONFIG_SATA_MOBILE_LPM_POLICY=3 which means that "SATA link PM" is enabled by default (Bug #898629), also Ubuntu now considering to apply it.
I'd say that's risky decision (Bug 1571330 - CONFIG_SATA_MOBILE_LPM_POLICY=3 makes laptop hang when changing screen brightness, Bug 1578072 - New F28 SATA AHCI LPM MOBILE POLICY causes suspend to fail on Lenovo ThinkPad W541, be prepared to add grub option for 4.17 kernel

Code: Select all

ahci.mobile_lpm_policy=0

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16165
Joined: Fri Dec 15, 2006 8:07 pm

Re: Power Saving improvements from Fedora 28

#8 Post by Stevo » Thu Jun 28, 2018 2:33 pm

We have a backport of that 4.17.2 from Experimental in our test repo, and so far those suspend bugs don't affect the MSI GP63 laptop I'm using. It would be interesting to see if anyone else is using it.

Alt
Forum Novice
Forum  Novice
Posts: 78
Joined: Wed Jan 27, 2016 1:28 am

Re: Power Saving improvements from Fedora 28

#9 Post by Alt » Thu Jun 28, 2018 6:45 pm

They also enabled CONFIG_SCSI_MQ_DEFAULT so I/O scheduler is now "mq-deadline" so with this kernel Debian moves forward.

Post Reply

Return to “Hardware /Configuration”