Matthew Garrett ([personal profile] mjg59) wrote2016-04-13 12:46 pm
Entry tags:

Skylake's power management under Linux is dreadful and you shouldn't buy one until it's fixed

(Edit to add: this issue is restricted to the mobile SKUs. Desktop parts have very different power management behaviour)

Linux 4.5 seems to have got Intel's Skylake platform (ie, 6th-generation Core CPUs) to the point where graphics work pretty reliably, which is great progress (4.4 tended to lose all my windows every so often, especially over suspend/resume). I'm even running Wayland happily. Unfortunately one of the reasons I have a laptop is that I want to be able to do things like use it on battery, and power consumption's an important part of that. Skylake continues the trend from Haswell of moving to an SoC-type model where clock and power domains are shared between components that were previously entirely independent, and so you can't enter deep power saving states unless multiple components all have the correct power management configuration. On Haswell/Broadwell this manifested in the form of Serial ATA link power management being involved in preventing the package from going into deep power saving states - setting that up correctly resulted in a reduction in full-system power consumption of about 40%[1].

I've now got a Skylake platform with a nice shiny NVMe device, so Serial ATA policy isn't relevant (the platform doesn't even expose a SATA controller). The deepest power saving state I can get into is PC3, despite Skylake supporting PC8 - so I'm probably consuming about 40% more power than I should be. And nobody seems to know what needs to be done to fix this. I've found no public documentation on the power management dependencies on Skylake. Turning on everything in Powertop doesn't improve anything. My battery life is pretty poor and the system is pretty warm.

The best thing about this is the following statement from page 64 of the 6th Generation Intel ® Processor Datasheet for U-Platforms:

Caution: Long term reliability cannot be assured unless all the Low-Power Idle States are enabled.

which is pretty concerning. Without support for states deeper than PC3, Linux is running in a configuration that Intel imply may trigger premature failure. That's obviously not good. Until this situation is improved, you probably shouldn't buy any Skylake systems if you're planning on running Linux.

[1] These patches never went upstream. Someone reported that they resulted in their SSD throwing errors and I couldn't find anybody with deeper levels of SATA experience who was interested in working on the problem. Intel's AHCI drivers for Windows do the right thing, but I couldn't find anybody at Intel who could get any information from their Windows driver team.

Two questions?

(Anonymous) 2016-04-17 03:37 pm (UTC)(link)
Bad news for me cause I wanted to buy i3-6100u laptop as [long term] Linux machine.
Got two questions:

1. How to check from system if above problem occur on my machine/linux system, what command to use?
2. Are all Skylake ULV chips affected, what about Pentiums, f.e. Pentium 4405U maybe they haven't got some problematic sleeps states, maybe they are cut for the budget sake?

(Anonymous) 2016-04-17 03:58 pm (UTC)(link)
It is a known regression - https://bugzilla.kernel.org/show_bug.cgi?id=115771. You could try to apply V5 patch from comment https://bugzilla.kernel.org/show_bug.cgi?id=115771#c106, it helped me a lot.

[personal profile] edmonds 2016-04-17 07:56 pm (UTC)(link)
This is from an Ubuntu Edition Dell XPS 13 9350 (i7-6560U), running BIOS 1.3.3.

powertop: http://paste.debian.net/plain/437840

lspci: http://paste.debian.net/plain/437841

It looks like it manages to reach PC8 some small amount of the time. But this system experiences GPU hangs in this configuration unless I boot with i915.enable_rc6=0.

I'm running Debian's kernel 4.6~rc3-1~exp1 and xserver-xorg-video-intel 2:2.99.917+git20160325-1, with latest i915 firmware from https://01.org/linuxgraphics/intel-linux-graphics-firmwares and iwlwifi firmware from http://git.kernel.org/cgit/linux/kernel/git/iwlwifi/linux-firmware.git.

Re: Skylake - can't even get past PC2

(Anonymous) 2016-04-18 03:13 pm (UTC)(link)
Replying myself - I was wrong, with line power plugged in it does not get past PC3 (I'm using TLP, not sure what's going on underlying). Using only battery it gets PC7.

Re: EFI updates

(Anonymous) 2016-04-18 07:56 pm (UTC)(link)
Thank you,

I found instructions for flashing the .exe, but you gave me .cab files. How can I flash .cabs?

Can still do the .exe method on the 9350?

(Anonymous) 2016-04-18 09:00 pm (UTC)(link)
Found something interesting here http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/desktop-6th-gen-core-family-spec-update.pdf
SKL083 - The Processor May Fail to Properly Exit Package C6 or Deeper
Maybe microcode disables such states because of this bug?

Regression from 4.4?

(Anonymous) 2016-04-18 11:07 pm (UTC)(link)
This seems like a regression to me. With 4.4.6, the CPU spends a significant amount of time (50+ percent) in PC8 and PC6. With 4.6-rc3, it very rarely reaches even PC3 (and never anything deeper than that), and when it does the screen starts randomly blacking out for short intervals. This is on a ThinkPad T460 with an i5 6300u.

Re: My mobile part is seeing pc8

(Anonymous) 2016-04-19 12:11 pm (UTC)(link)
If you happen to follow up can you give some details on your kernel and any configuration you did?

(Anonymous) 2016-04-19 01:53 pm (UTC)(link)
My P70 (Xeon 1505m) is sitting in C2 on Arch 4.5.1 ... any ideas about what I might be able to do to achieve the C8+ others have seen on Xeon?

further advice required

(Anonymous) 2016-04-21 07:06 am (UTC)(link)
could you be more specific on effects ie battery life? say windows gets 9 hours what could one expect on the latest kernel? i note that Dell already ships ubuntu with skylake and would find it therefore surprising if impact was really so bad. (im not interested in long term life)

The reason is iGPU

(Anonymous) 2016-04-23 12:50 pm (UTC)(link)
it seems that the reason for not reaching PC6+ is iGPU. I've updated my system to kernel from https://cgit.freedesktop.org/drm-intel/log/?h=drm-intel-next to fix screen flickering, and also applied patch from http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ffb810563c0c049872a504978e06c8892104fb6c (which is a regression fix for kernel 4.6), and now I'm mostly in PC6 and PC8. Also, turbostat showing that GPU frequency is mostly 300MHz, whereas it was more higher on vanilla 4.5.0 and 4.6.0-rc3, so it seems that it was the reason why he whole packages cannot reach states deeper than PC3.

P.S. Applying regression fix only is not enough - it's a drm-intel-next which contains main fix.

Re: Regression from 4.4?

(Anonymous) 2016-04-23 04:11 pm (UTC)(link)
I'm seeing this as well on a Dell xps-13 9350 with debian kernels 4.4 and 4.5 - spends 60% of time in pc8 on 4.4 and initially also on 4.5, but after X login 4.5 spends all of its time in pc2/3.

I don't have graphics problems and don't use suspend/hibernate.

Re: The reason is iGPU

(Anonymous) 2016-04-24 12:12 pm (UTC)(link)
I've just rebuilt from the drm-intel-next git + your suggested patch and I still can't get lower than PC3, do you have more information about your hardware?

XPS 15 9550

[personal profile] bradlaue 2016-04-24 03:24 pm (UTC)(link)
With the NVMe drive. Interested in a challenge, I installed Gentoo on the machine - configuring the kernel with intel_idle and enabling ACPI / tuning power management according to various sources of documentation doesn't get me past PC3.

Using Fedora 23 (installed from a respin as the original 4.2 kernel can't make it through the install process) powertop reports the Package entering PC8 though.

An earlier post of yours indicates multiple subsystems like SATA and I2C have to succeed in entering a power saving state before the entire Skylake package itself will also. My nearest guess so far is that's related?

EDIT: Actually your earlier post was related to haswell/broadwell. My mistake!

I assume you're also using Fedora 23 though, which makes it doubly mysterious.
Edited 2016-04-24 15:26 (UTC)

Re: XPS 15 9550

(Anonymous) 2016-04-24 09:20 pm (UTC)(link)
I was referring to a Skylake platform though, I suppose I replied to the wrong thread. I have a XPS 13 9350

HP laptops

(Anonymous) 2016-04-25 10:22 pm (UTC)(link)
Don't ever buy them - this company doesn't give a fuck about the end user. No BIOS updates, nothing.

And PC8 sleep state is obviously not supported on HP Skylake laptops. Do not expect a BIOS fix or anything. Your support requests will be ignored (I've filed three already - no results).

Re: The reason is iGPU

(Anonymous) 2016-04-26 07:12 pm (UTC)(link)
It's T460s with i7-6600U (exact model 20F9003WRT, CPU microcode version 0x84). I could reach PC7/8 every time I'm on battery, on commit ba3150ac3876acd082307f142597d3482107facc of drm-intel + commit which fixes 4.6 regression. I'm also using TLP which forces ALPM (min_power) and setting energy_perf_policy to powersave. Hope this will help you.

Re: The reason is iGPU

(Anonymous) 2016-04-27 05:48 am (UTC)(link)
I'm on a Dell XPS 13 9350 :(
I checked and I remmber I was getting to PC8 or PC10 with kernel 4.4 (I have a screenshoot which I posted to a group), but unfortunately since the BIOS update I can't get to it anymore. I think that, in my case, it's something related to the NVME managemnet.

Re: The reason is iGPU

(Anonymous) 2016-04-27 06:52 am (UTC)(link)
Yes, NVMe could be a reason, I heard that there is no PM implemented for it.

Re: EFI updates

[personal profile] gourdcaptain 2016-05-01 07:43 am (UTC)(link)
Just to make google searches for this a bit more helpful, some experimentation later seems to link these random boot crashes to the i2c bus going funky when a bunch of stuff tries to hit it all at once during boot: https://bugzilla.kernel.org/show_bug.cgi?id=105251

Doing a weird workaround involving delaying loading hid_multitouch seems to cut down the boot failures by a fair amount: https://bugzilla.redhat.com/show_bug.cgi?id=1297188#c13
(NOTE: Still seem to happen a fair amount, did some statistical testing but still might be the placebo effect.)
Edited 2016-05-09 20:36 (UTC)

Re: Nasty issues with Linux 4.2, Skylake and NVMe

(Anonymous) 2016-05-05 04:04 am (UTC)(link)
I had the same issue, you can resolve it by adding `nvme` to `/etc/initramfs-tools/modules` and then running `sudo update-initramfs -u`. While this works, I found that because of incompatibilities with mesa and the kernel, a lot of video glitches occur even at 4.5.

Dell Precision 5510, i7-6820HQ, Fedora 23

(Anonymous) 2016-05-05 12:09 pm (UTC)(link)
Dell Precision 5510 ( pretty much the same as the XPS15)
i7-6820HQ,
Samsung M.2 PM971 (NVMe)
Fedora 23, Rawhide kernel - 4.6.0-0.rc6.git1.1.fc25.x86_64

I was only getting to c3 ( package ), but managed to get to C8 by disabling the Nvidia Quadro, once I found out where to get bbswitch-dkms from

https://fedoraproject.org/wiki/Bumblebee

For anyone wanting to repeat ..

dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora23/noarch/bumblebee-release-1.2-1.noarch.rpm
dnf install bbswitch-dkms
modprobe bbswitch
echo OFF > /proc/acpi/bbswitch

Package
C2 (pc2) 4.8%
C3 (pc3) 2.6%
C6 (pc6) 3.9%
C7 (pc7) 0.0%
C8 (pc8) 18.4%
C9 (pc9) 0.0%
C10 (pc10) 0.0

Re: EFI updates

[personal profile] gourdcaptain 2016-05-09 08:38 pm (UTC)(link)
There was a new UEFI update for the laptop released a few days ago. Windows install only. So after going to the trouble of installing Windows 10 to an external USB drive to boot off of and run the update (I really didn't feel like repartitioning the drive or having to image and restore it) that actualy worked to do the update.

But it's still 0x74 microcode. (facepalm)

Wish I had read this before I bought my new laptop

(Anonymous) 2016-05-10 07:54 pm (UTC)(link)
Thank you for this article. I wish I had read it BEFORE I bought my new computer. Why doesn't Intel provide info on how to fix this? I mean, if I understand you right they even made the drivers for windows, not only helped the folks at Microsoft. So at least they should provide the necessary info so other people who don't want to run Windows can create the required drivers for their OSes, too.

Right now I'm thinking about turning the bought computer back in, and choose another one, then maybe without Intel inside. At least one thing's for sure: I will be VERY careful next time when looking for a new computer, and if Intel doesn't change their policy about support for other OS this will have been the last Intel product I've ever purchased.

Re: SATA PM Patches

(Anonymous) 2016-05-22 11:18 pm (UTC)(link)
It would be nice if affected models would be named, at least people would be aware or steer clear of those models.

Page 4 of 6