Bug 116671 - Kernel power policy doesn't allow mobile Intel processors to enter deep PC states, potentially reducing system lifespan
Summary: Kernel power policy doesn't allow mobile Intel processors to enter deep PC st...
Status: REOPENED
Alias: None
Product: Power Management
Classification: Unclassified
Component: cpuidle (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: Zhang Rui
URL:
Keywords:
: 116591 116711 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-04-18 21:25 UTC by Matthew Garrett
Modified: 2018-10-17 02:55 UTC (History)
12 users (show)

See Also:
Kernel Version: 4.6-rc1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
throttling adjust during resume (1.51 KB, text/plain)
2016-06-20 05:39 UTC, Chen Yu
Details

Description Matthew Garrett 2016-04-18 21:25:09 UTC
The processor datasheet for recent mobile Intel CPUs has the following warning:

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

On most systems, the kernel fails to configure hardware such that deep low-power idle states can be reached. There is little or no documentation for what has to be done to achieve these low-power states, but at minimum the kernel should be defaulting to a reasonable SATA power management policy on these systems. The patchset at https://github.com/mjg59/linux/tree/sata-lpm-firmware attempts to do this by:

a) Defaulting to the configuration provided by the firmware on Intel systems, and
b) Changing the behaviour of the medium_power LPM policy to match the documented behaviour of the Intel AHCI driver for Windows.

However, this is (to a large extent) still based on guesswork - in the absence of any documentation on the constraints around entering deep PC states, it's impossible to know how many systems may be working outside their design specs due to the kernel failing to enable features.
Comment 1 Zhang Rui 2016-04-25 23:13:18 UTC
*** Bug 116711 has been marked as a duplicate of this bug. ***
Comment 2 Zhang Rui 2016-05-15 05:17:48 UTC
*** Bug 116591 has been marked as a duplicate of this bug. ***
Comment 3 Zhang Rui 2016-05-15 05:17:59 UTC
Hi, Matthew,
what's the status of the patch set? are they target for upstream?

BTW, referring https://mjg59.dreamwidth.org/41713.html, I thought this problem is observed on Intel Skylake only, is that true?
Comment 4 James Long 2016-06-14 15:45:28 UTC
I would expect this to be of higher priority. Is it being worked on another ticket?
Comment 5 Zhang Rui 2016-06-16 02:51:44 UTC
We need Matthew to clarify.
Comment 6 Matthew Garrett 2016-06-20 05:32:54 UTC
The patchset can't currently be upstreamed - the policy triggers ATA errors on a small number of devices, so we need to know how the Intel Rapid Storage Technology drivers behave under Windows. I don't have access to that information.

The broader issue affects both Skylake and Broadwell - I'm unsure whether Haswell is affected. I think previous generations are ok.
Comment 7 Chen Yu 2016-06-20 05:39:29 UTC
Created attachment 220661 [details]
throttling adjust during resume

@Matthew, BTW, while I have your ear, could you please confirm if the following patch work for you for the problem of clock modulation on Skylake?
https://patchwork.kernel.org/patch/7692241/
thanks
Comment 8 Ian Ozsvald 2016-08-20 11:31:01 UTC
At the risk of adding noise I'd like to note that on my XPS 9550 it seems to be the nvidia driver that hurts power saving. With my NVMe SSD and nouveau I get to PC8, with the nvidia proprietary driver I only get to PC3.

I have a Dell XPS 9550 UHD 32GB RAM, UEFI: PM951 NVMe SAMSUNG 1024GB SSD, Broadcom BCM43602 wifi, Intel(R) Core(TM) i7-6700HQ Skylake CPU. This model has an Nvidia GM107M [GeForce GTX 960M], the i7 has its own GPU.

Using kernel 4.7.0-040700-generic in various graphics modes changes the behaviour reported by powertop 2.8. In each case this is a fresh boot on battery, full brightness (100%), wifi on and connected to my home network, no browser or applications. I'm running stock Mint 18 Cinnamon, no TLP other other power management extras.

Via Driver Manager I can select either nvidia 361.42 or nouveau 1:1.0.12.

* nvidia driver, nvidia GPU selected, PC2/PC3 only, baseline power estimate 22W
* nvidia driver, intel GPU selected, PC2/PC3 only, baseline power estimate 22W
* nouveau driver, PC2/PC3/PC6/PC7/PC8, baseline power estimate  16W

I've repeated the configuration cycle twice and I've been using the nouveau driver for several days, I'm convinced this result is stable. Using the nvidia driver and 4.7.0 I only ever get PC2/PC3, never deeper states. 

On mjg's site this thread https://mjg59.dreamwidth.org/41713.html?thread=1653489#cmt1653489 makes the same nvidia/nouveau observation (my comment is last), this comment makes a similar note: https://mjg59.dreamwidth.org/41713.html?thread=1652977#cmt1652977

A few weeks back when using the 4.4.0 kernel and the nvidia driver I knew I had up to PC8. This week I also tested 4.5.7 with the nvidia driver and I have up to PC8. Using 4.6.4 and nvidia I only get to PC3.

I have a few historic notes here: https://ubuntuforums.org/showthread.php?t=2301071&page=32&p=13470668#post13470668
Comment 9 Zhang Rui 2017-04-12 06:56:46 UTC
Ian,

(In reply to Ian Ozsvald from comment #8)
> At the risk of adding noise I'd like to note that on my XPS 9550 it seems to
> be the nvidia driver that hurts power saving. With my NVMe SSD and nouveau I
> get to PC8, with the nvidia proprietary driver I only get to PC3.
> 
Sorry, we will not work on problems with proprietary driver loaded.
please file a bug report if the problem is also there with the upstream kernel driver.
Comment 10 Zhang Rui 2017-04-12 06:58:35 UTC
I have not heard about this for a long time.
I'd prefer to have the bug closed, and please feel free to reopen it if the problem described is still valid in latest upstream kernel.
Comment 11 Matthew Garrett 2017-04-12 07:05:15 UTC
Kernel still doesn't do anything to enable SATA power management by default, so the bug is still present.
Comment 12 Anne van Rossum 2017-04-12 14:46:08 UTC
Bug still present.

4.10.4 kernel
Comment 13 Ryan Underwood 2017-04-12 14:58:41 UTC
Kernel 4.10.9, all I get is PC3 on a Skylake 6300HQ.  Ubuntu Zesty with no proprietary drivers.

Note You need to log in before you can comment on or make changes to this bug.