You are not logged in.

#1 2018-09-07 15:00:15

DeadLink404
Member
Registered: 2017-11-24
Posts: 37

[Solved] Package C state not going deeper than 3

I have an optimus laptop with an i7-7820HK and gtx 1070 with the dGPU managed through bumblebee.
I followed the recommendations on the wiki on power management
to try and optimize battery usage further.

Yet powertop is reporting 90% pc3 residency and 0% for pc6 to pc10. On windows pcm reports about 50% pc8 residency.
According to a intel data-sheet this might affect the longevity of the processor so it is not necessarily a question of just squeezing out a few seconds of battery time.

Here are all the modifications I took:

I blacklisted uvcvide, btusb and bluetooth to disable bluetooth and the webcam.
I enabled USB autosuspend per udev rules (with a whitelist).

And enabled Runtime PM for pci in
/etc/udev/rules.d/pci_pm.rules

ACTION=="add", SUBSYSTEM=="pci", ATTR{power/control}="auto"

/etc/modprobe.d/audio_powersafe.conf

options snd_hda_intel power_save=1

/etc/modprobe.d/i915.conf

options i915 enable_dpcd_backlight=1 enable_psr=1 enable_guc=3

My SATA ssds where already on med_power_with_dipm so I didn't touch that.
So exept that and nmi_watchdog and VM writeback timeout everything in powertop is good.
Setting the rest to good didn't seem to have any effect anyway.

Lastly I set the cpu scaling governor with the file:
/etc/tmpfiles.d/energy_performance_preference.conf

w /sys/devices/system/cpu/cpufreq/policy?/energy_performance_preference - - - - balance_power

And according to x86_energy_perf_policy this should set EPB to 8 and epp to 192,
however the EPB does not seem to be changed.

cpu0: EPB 6
cpu0: HWP_REQ: min 8 max 39 des 0 epp 192 window 0x0 (0*10^0us) use_pkg 0
cpu0: HWP_CAP: low 1 eff 8 guar 29 high 39

But manually setting EPB does not seem to change the problem, so this might be irrelevant.


What I did find is that ASPM is disabled althoug all devices have L0s and L1 states.

dmesg |grep ASPM

[    0.376840] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
[    0.478529] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]
[    0.478576] acpi PNP0A08:00: _OSC failed (AE_ERROR); disabling ASPM
[    3.851085] r8169 0000:6d:00.1: can't disable ASPM; OS doesn't have ASPM control

lspci -vv | grep 'ASPM.*abled'

		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk+
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk-
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk+
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
pcilib: sysfs_read_vpd: read failed: Input/output error
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
pcilib: sysfs_read_vpd: read failed: Input/output error
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+

The two disabled ones are the PCI controller and the gtx 1070 connected to it.

with pcie_aspm=force actually disables aspm for the ethernet controller and the root controller it sits on as well.

dmesg | grep ASPM

[    0.000000] PCIe ASPM is forcibly enabled
[    0.376858] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
[    0.474936] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]
[    0.474983] acpi PNP0A08:00: _OSC failed (AE_ERROR); disabling ASPM

lspci -vv | grep 'ASPM.*abled'

		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk+
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk-
		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk+
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk+
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
pcilib: sysfs_read_vpd: read failed: Input/output error
		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk+
pcilib: sysfs_read_vpd: read failed: Input/output error
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+

However even manually enabling ASPM with setpci (which might have been stupid to try) does not change pc residency.
So now I am out of thing to try.

Last edited by DeadLink404 (2018-09-13 20:44:29)

Offline

#2 2018-09-12 01:44:13

laloch
Member
Registered: 2010-02-04
Posts: 185

Re: [Solved] Package C state not going deeper than 3

Hi, what does

cat /sys/class/scsi_host/host*/link_power_management_policy

show? If it reads "max_performance", try changing it to "min_power" or "medium_power" and observe the results.

Offline

#3 2018-09-12 19:38:51

DeadLink404
Member
Registered: 2017-11-24
Posts: 37

Re: [Solved] Package C state not going deeper than 3

They are all "med_power_with_dipm" by default but I have tried setting them to min_power through powertop already.

Offline

#4 2018-09-13 12:02:43

fabledpig
Member
Registered: 2013-03-15
Posts: 24

Re: [Solved] Package C state not going deeper than 3

Hi! Try this: https://bbs.archlinux.org/viewtopic.php … 0#p1725560

BTW ASPM for r8169 is being re-enabled in 4.19.

Last edited by fabledpig (2018-09-13 12:03:57)

Offline

#5 2018-09-13 20:44:02

DeadLink404
Member
Registered: 2017-11-24
Posts: 37

Re: [Solved] Package C state not going deeper than 3

fabledpig wrote:

Hi! Try this: https://bbs.archlinux.org/viewtopic.php … 0#p1725560

BTW ASPM for r8169 is being re-enabled in 4.19.

Oh man thank you so much.
Using r8168 with r8168.aspm=1 does work.
I now reach pc8 (same as in windows) and this saves about 3-5 watts when idling,
which is awesome.

Looking forward to what 4.19 brings.

Last edited by DeadLink404 (2018-09-13 20:58:40)

Offline

Board footer

Powered by FluxBB