No C-State Deeper than C3 utilized by Kaby Lake 7820HQ in Precision 5520

Bug #1672439 reported by Carl Mueller
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Unassigned
Xenial
Fix Released
Medium
Kai-Heng Feng

Bug Description

My processor does not appear to be utilizing and idling states deeper than C3.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: linux-image-4.4.0-66-generic 4.4.0-66.87
ProcVersionSignature: Ubuntu 4.4.0-66.87-generic 4.4.44
Uname: Linux 4.4.0-66-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: carl 2446 F.... pulseaudio
CurrentDesktop: Unity
Date: Mon Mar 13 08:57:06 2017
DistributionChannelDescriptor:
 # This is a distribution channel descriptor
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-somerville-xenial-amd64-20160624-2
HibernationDevice: RESUME=UUID=65474558-ead3-4d66-85e5-b55f81978b88
InstallationDate: Installed on 2017-03-09 (3 days ago)
InstallationMedia: Ubuntu 16.04 "Xenial" - Build amd64 LIVE Binary 20160624-10:47
IwConfig:
 lo no wireless extensions.

 wlp2s0 no wireless extensions.
MachineType: Dell Inc. Precision 5520
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-66-generic.efi.signed root=UUID=d19efcb8-515b-494c-a236-ee0da23f2393 ro acpi_rev_override locale=C quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-4.4.0-66-generic N/A
 linux-backports-modules-4.4.0-66-generic N/A
 linux-firmware 1.157.8
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 01/18/2017
dmi.bios.vendor: Dell Inc.
dmi.bios.version: 1.1.3
dmi.board.name: 0X41RR
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 10
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvr1.1.3:bd01/18/2017:svnDellInc.:pnPrecision5520:pvr:rvnDellInc.:rn0X41RR:rvrA00:cvnDellInc.:ct10:cvr:
dmi.product.name: Precision 5520
dmi.sys.vendor: Dell Inc.

CVE References

Revision history for this message
Carl Mueller (cmuell89) wrote :
Revision history for this message
Carl Mueller (cmuell89) wrote :

cat /sys/module/intel_idle/parameters/max_cstate

~$ cat /sys/module/intel_idle/parameters/max_cstate
9

Revision history for this message
Brad Figg (brad-figg) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Carl Mueller (cmuell89) wrote :

~$ sudo powertop (Idle Stats tab)

          Package | Core | CPU 0 CPU 4
POLL 0.0% | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
C1 0.8% | C1 0.3% | C1 0.3% 0.2 ms 0.4% 0.6 ms
C2 12.7% | C2 7.2% | C2 10.4% 1.6 ms 4.0% 4.1 ms
C3 81.7% | C3 89.4% | C3 84.6% 6.6 ms 94.0% 8.9 ms

                    | Core | CPU 1 CPU 5
                    | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C1 1.7% | C1 3.3% 0.9 ms 0.1% 0.2 ms
                    | C2 15.7% | C2 26.0% 1.8 ms 5.4% 2.0 ms
                    | C3 74.0% | C3 65.5% 4.0 ms 82.4% 25.2 ms

                    | Core | CPU 2 CPU 6
                    | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C1 0.7% | C1 1.1% 0.2 ms 0.2% 0.2 ms
                    | C2 15.0% | C2 17.2% 2.3 ms 12.7% 1.1 ms
                    | C3 81.0% | C3 78.7% 5.4 ms 83.2% 7.9 ms

                    | Core | CPU 3 CPU 7
                    | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C1 0.4% | C1 0.8% 0.2 ms 0.1% 0.1 ms
                    | C2 12.6% | C2 23.6% 1.3 ms 1.7% 1.6 ms
                    | C3 81.8% | C3 69.1% 4.7 ms 94.5% 9.4 ms

Revision history for this message
Carl Mueller (cmuell89) wrote :

~$ sudo turbostat

cpu0: Guessing tjMax 100 C, Please use -T to specify
     CPU Avg_MHz Busy% Bzy_MHz TSC_MHz
       - 100 6.63 1500 2904
       0 109 7.27 1500 2904
       4 80 5.33 1501 2904
       1 133 8.85 1498 2904
       5 93 6.21 1501 2904
       2 116 7.73 1500 2904
       6 86 5.73 1500 2904
       3 116 7.70 1500 2904
       7 64 4.25 1500 2904
     CPU Avg_MHz Busy% Bzy_MHz TSC_MHz
       - 158 10.52 1501 2904
       0 174 11.60 1501 2904
       4 105 7.02 1502 2904
       1 178 11.87 1499 2904
       5 128 8.53 1501 2904
       2 191 12.71 1501 2904
       6 145 9.65 1500 2904
       3 205 13.67 1501 2904
       7 137 9.11 1502 2904

Revision history for this message
Carl Mueller (cmuell89) wrote :

Installed:

intel-microcode_3.20161104.1~deb8u1~bpo7+1_amd6

Revision history for this message
Carl Mueller (cmuell89) wrote :

~$ dmesg |grep idle

[ 0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[ 0.000000] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635855245 ns
[ 0.044934] process: using mwait in idle threads
[ 0.153005] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.162345] cpuidle: using governor ladder
[ 0.178334] cpuidle: using governor menu
[ 0.343661] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[ 0.899900] intel_idle: does not run on family 6 model 158
[ 0.901622] ACPI: acpi_idle registered with cpuidle
[ 1.894828] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x29dc020bb13, max_idle_ns: 440795273180 ns

Revision history for this message
Carl Mueller (cmuell89) wrote :
Download full text (3.4 KiB)

~$ sudo i7z

sudo i7z
i7z DEBUG: i7z version: svn-r93-(27-MAY-2013)
i7z DEBUG: Found Intel Processor
i7z DEBUG: Stepping 9
i7z DEBUG: Model e
i7z DEBUG: Family 6
i7z DEBUG: Processor Type 0
i7z DEBUG: Extended Model 9
i7z DEBUG: msr = Model Specific Register
i7z DEBUG: Unknown processor, not exactly based on Nehalem, Sandy bridge or Ivy Bridge
i7z DEBUG: msr device files exist /dev/cpu/*/msr
i7z DEBUG: You have write permissions to msr device files

------------------------------
--[core id]--- Other information
-------------------------------------
--[0] Processor number 0
--[0] Socket number/Hyperthreaded Sibling number 0,4
--[0] Core id number 0
--[0] Display core in i7z Tool: Yes

--[1] Processor number 1
--[1] Socket number/Hyperthreaded Sibling number 0,5
--[1] Core id number 1
--[1] Display core in i7z Tool: Yes

--[2] Processor number 2
--[2] Socket number/Hyperthreaded Sibling number 0,6
--[2] Core id number 2
--[2] Display core in i7z Tool: Yes

--[3] Processor number 3
--[3] Socket number/Hyperthreaded Sibling number 0,7
--[3] Core id number 3
--[3] Display core in i7z Tool: Yes

--[4] Processor number 4
--[4] Socket number/Hyperthreaded Sibling number 0,0
--[4] Core id number 0
--[4] Display core in i7z Tool: No

--[5] Processor number 5
--[5] Socket number/Hyperthreaded Sibling number 0,1
--[5] Core id number 1
--[5] Display core in i7z Tool: No

--[6] Processor number 6
--[6] Socket number/Hyperthreaded Sibling number 0,2
--[6] Core id number 2
--[6] Display core in i7z Tool: No

--[7] Processor number 7
--[7] Socket number/Hyperthreaded Sibling number 0,3
--[7] Core id number 3
--[7] Display core in i7z Tool: No

Socket-0 [num of cpus 4 physical 4 logical 8] 0,1,2,3,
Socket-1 [num of cpus 0 physical 0 logical 0]
GUI has been Turned ON
i7z DEBUG: Single Socket Detected
i7z DEBUG: In i7z Single_Socket()
i7z DEBUG: guessing Nehalem

--------
AND THEN
--------

Cpu speed from cpuinfo 2903.00Mhz
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc
Linux's inbuilt cpu_khz code emulated now
True Frequency (without accounting Turbo) 2903 MHz
  CPU Multiplier 29x || Bus clock frequency (BCLK) 100.10 MHz

Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]
  TURBO ENABLED on 4 Cores, Hyper Threading ON
  Max Frequency without considering Turbo 3003.10 MHz (100.10 x [30])
  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is 39x/37x/36x/35x
  Real Current Frequency 1557.86 MHz [100.10 x 15.56] (Max of below)
        Core [core-id] :Actual Freq (Mult.) C0% Halt(C1)% C3 % C6 % Temp VCore
        Core 1 [0]: 1516.07 (15.15x) 2.86 98.5 0 0 39 0.7573
        Core 2 [1]: 1557.86 (15.56x) 2.16 98.8 0 0 37 0.7573
        Core 3 [2]: 1533.17 (15.32x) 2.15 98.9 0 0 39 0.7550
        Core 4 [3]: 1554.47 (15.53x) 1.51 98.2 1 0 38 0.7552

C0 = Processor running without halting
C1 = Processor running with halts (States >C0 are power saver modes with cores idling)
C3 = Cores running with PLL turned off and core cache...

Read more...

Revision history for this message
Carl Mueller (cmuell89) wrote :

Let me know what other information I could supply.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Did this issue start happening after an update/upgrade? Was there a prior kernel version where you were not having this particular problem?

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v4.11 kernel[0].

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11-rc2

Changed in linux (Ubuntu):
importance: Undecided → Medium
Changed in linux (Ubuntu Xenial):
status: New → Incomplete
importance: Undecided → Medium
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

I tested on an KBL laptop and it did have the issue. Backport a patch can make the machine idle to C10.

commit 3ce093d4de753d6c92cc09366e29d0618a62f542
Author: Len Brown <email address hidden>
Date: Wed Apr 6 17:00:59 2016 -0400

    intel_idle: Add KBL support

    KBL is similar to SKL

    Signed-off-by: Len Brown <email address hidden>
    Signed-off-by: Rafael J. Wysocki <email address hidden>

Please test the Xenial kernel: http://people.canonical.com/~khfeng/lp1672439/

Revision history for this message
Carl Mueller (cmuell89) wrote :

@Kai-Heng Feng, What are the odds of this backport patch being included with the next update from Canonical for 16.04. Since your recommended kernel is 4.4.0-68 do you think it will arrive as part of the regular release schedule? I can report if the patch worked when it arrives. As much as I love to support the work on these bugs, jumping kernels has left sour taste in my mouth. Switching between two kernels has sometimes created issues (bluetooth drivers not loading etc,.) that carry over into the previously stable kernel.

Mostly this is my production/work machine and I am resistant to messing with it too much. :(

Sorry to sound like a poor sport.

C

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

No, that's why I built a slightly newer kernel, 4.4.0-68, so it won't mess with the current release kernel, 4.4.0-66.

It's okay if don't want to test it, I already tested it on Precision 5520 at my hand.

The problem lies here is, 5520 has several different configs, I want to make sure the patch works on your machine. Otherwise what's the point?

I assume the bluetooth symptom you saw mainly relates to the non-matching firmware is still in the chip, a cold boot instead of warm reboot should circumvent it.

Revision history for this message
Carl Mueller (cmuell89) wrote :

Okay. I'll try it out.

Revision history for this message
Carl Mueller (cmuell89) wrote :

Should I install all four .deb packages in the link you provided?

Revision history for this message
Carl Mueller (cmuell89) wrote :

Just an FYI, I do see this warning every time I've tried to build a kernel on my 5520. Not sure if this is an issue.

: Unable to find an initial ram disk that I know how to handle.
Will not try to make an initrd.

Revision history for this message
Carl Mueller (cmuell89) wrote :

Okay. Right away I notice a difference with the program i7z:

Cpu speed from cpuinfo 2875.00Mhz
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc
Linux's inbuilt cpu_khz code emulated now
True Frequency (without accounting Turbo) 2895 MHz
  CPU Multiplier 29x || Bus clock frequency (BCLK) 99.83 MHz

Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]
  TURBO ENABLED on 4 Cores, Hyper Threading ON
  Max Frequency without considering Turbo 2994.83 MHz (99.83 x [30])
  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is 39x/37x/36x/35x
  Real Current Frequency 2881.62 MHz [99.83 x 28.87] (Max of below)
        Core [core-id] :Actual Freq (Mult.) C0% Halt(C1)% C3 % C6 % Temp VCore
        Core 1 [0]: 2865.41 (28.70x) 1.77 96.2 1 1 46 1.0009
        Core 2 [1]: 2874.93 (28.80x) 1.74 86.3 1 11 46 0.9927
        Core 3 [2]: 2881.62 (28.87x) 1.34 96.1 1 1.55 46 1.0076
        Core 4 [3]: 2877.37 (28.82x) 1.4 95 1 2.62 46 1.0226

C0 = Processor running without halting
C1 = Processor running with halts (States >C0 are power saver modes with cores idling)
C3 = Cores running with PLL turned off and core cache turned off
C6, C7 = Everything in C3 + core state saved to last level cache, C7 is deeper than C6
  Above values in table are in percentage over the last 1 sec

WAY MORE activity in C6 state. Although I don't see any listings for C10

Revision history for this message
Carl Mueller (cmuell89) wrote :

sudo powertop (idel stats)

          Package | Core | CPU 0 CPU 4
POLL 0.0% | POLL 0.0% | POLL 0.0% 0.0 ms 0.1% 3.1 ms
C1E-SKL 0.5% | C1E-SKL 0.2% | C1E-SKL 0.4% 0.6 ms 0.0% 0.1 ms
C3-SKL 0.2% | C3-SKL 0.1% | C3-SKL 0.2% 0.4 ms 0.0% 0.1 ms
C6-SKL 2.8% | C6-SKL 1.5% | C6-SKL 1.8% 0.7 ms 1.2% 1.4 ms
C7s-SKL 0.2% | C7s-SKL 0.0% | C7s-SKL 0.0% 1.7 ms 0.0% 0.0 ms
C8-SKL 24.2% | C8-SKL 19.7% | C8-SKL 29.2% 3.1 ms 10.2% 3.9 ms
C9-SKL 0.0% | C9-SKL 0.0% | C9-SKL 0.0% 0.0 ms 0.0% 1.1 ms
C10-SKL 67.5% | C10-SKL 75.3% | C10-SKL 63.9% 11.5 ms 86.7% 17.5 ms

                    | Core | CPU 1 CPU 5
                    | POLL 0.1% | POLL 0.2% 3.8 ms 0.0% 0.0 ms
                    | C1E-SKL 0.8% | C1E-SKL 1.0% 0.4 ms 0.5% 0.7 ms
                    | C3-SKL 0.3% | C3-SKL 0.6% 0.5 ms 0.0% 0.2 ms
                    | C6-SKL 4.3% | C6-SKL 6.1% 0.8 ms 2.5% 0.9 ms
                    | C7s-SKL 0.5% | C7s-SKL 1.0% 1.4 ms 0.1% 1.5 ms
                    | C8-SKL 29.9% | C8-SKL 48.0% 2.9 ms 11.7% 3.3 ms
                    | C9-SKL 0.1% | C9-SKL 0.1% 1.7 ms 0.0% 1.9 ms
                    | C10-SKL 57.5% | C10-SKL 37.3% 5.6 ms 77.7% 14.9 ms

                    | Core | CPU 2 CPU 6
                    | POLL 0.0% | POLL 0.0% 1.1 ms 0.0% 0.0 ms
                    | C1E-SKL 0.5% | C1E-SKL 0.6% 0.6 ms 0.5% 0.6 ms
                    | C3-SKL 0.2% | C3-SKL 0.2% 0.4 ms 0.1% 0.3 ms
                    | C6-SKL 3.2% | C6-SKL 2.0% 0.7 ms 4.4% 1.4 ms
                    | C7s-SKL 0.0% | C7s-SKL 0.1% 1.1 ms 0.0% 1.4 ms
                    | C8-SKL 27.0% | C8-SKL 36.4% 3.3 ms 17.5% 2.8 ms
                    | C9-SKL 0.0% | C9-SKL 0.0% 0.7 ms 0.0% 0.0 ms
                    | C10-SKL 64.5% | C10-SKL 56.3% 8.7 ms 72.8% 16.1 ms

                    | Core | CPU 3 CPU 7
                    | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C1E-SKL 0.6% | C1E-SKL 0.8% 1.1 ms 0.3% 1.2 ms
                    | C3-SKL 0.1% | C3-SKL 0.1% 0.2 ms 0.0% 0.3 ms
                    | C6-SKL 2.2% | C6-SKL 1.6% 0.6 ms 2.8% 2.7 ms
                    | C7s-SKL 0.0% | C7s-SKL 0.1% 1.9 ms 0.0% 0.9 ms
                    | C8-SKL 20.4% | C8-SKL 30.4% 3.6 ms 10.5% 2.8 ms
                    | C9-SKL 0.0% | C9-SKL 0.0% 0.0 ms 0.0% 0.1 ms
                    | C10-SKL 72.6% | C10-SKL 62.4% 9.9 ms 82.9% 17.6 ms

Revision history for this message
Carl Mueller (cmuell89) wrote :
Download full text (3.5 KiB)

However, I notcied powertop is now not automatically choosing to adjust many of the bad parameters to good (not sure if that is related...). Most of the PCI devices are not set to Bad when previously they were automatically at Good.

Bad Enable SATA link power management for host0
   Bad Enable SATA link power management for host1
   Bad Enable Audio codec power management
   Bad Runtime PM for I2C Adapter i2c-2 (i915 gmbus dpd)
   Bad Autosuspend for USB device USB Receiver [Logitech]
   Bad Runtime PM for I2C Adapter i2c-1 (i915 gmbus dpb)
   Bad Autosuspend for USB device Touchscreen [ELAN]
   Bad Runtime PM for I2C Adapter i2c-0 (i915 gmbus dpc)
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H PCI Express Root Por
   Bad Runtime PM for PCI Device Realtek Semiconductor Co., Ltd. RTS525A PCI Express Ca
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H PCI Express Root Por
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H PCI Express Root Por
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H PCI Express Root Por
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H PMC
   Bad Runtime PM for PCI Device Intel Corporation Device a171
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H SMBus
   Bad Runtime PM for PCI Device NVIDIA Corporation Device 13b6
   Bad Runtime PM for PCI Device Intel Corporation Device 24fd
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H LPC Controller
   Bad Runtime PM for PCI Device Samsung Electronics Co Ltd Device a804
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H SATA controller [AHC
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H CSME HECI #1
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H LPSS I2C Controller
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H LPSS I2C Controller
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H Thermal subsystem
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H USB 3.0 xHCI Control
   Bad Runtime PM for PCI Device Intel Corporation Device 591b
   Bad Runtime PM for PCI Device Intel Corporation Sky Lake PCIe Controller (x16)
   Bad Runtime PM for PCI Device Intel Corporation Device 5910
   Bad Runtime PM for PCI Device Intel Corporation Sunrise Point-H PCI Express Root Por
   Bad Runtime PM for PCI Device Intel Corporation Skylake Processor Thermal Subsystem
   Good Bluetooth device interface status
   Good NMI watchdog should be turned off
   Good VM writeback timeout
   Good Autosuspend for USB device xHCI Host Controller [usb1]
   Good Autosuspend for USB device xHCI Host Controller [usb2]
   Good I2C Device i2c-DLL07BF:01 has no runtime power management
   Good ...

Read more...

Revision history for this message
Carl Mueller (cmuell89) wrote :

Also trying to run turbostat:

sudo turbostat --debug
WARNING: turbostat not found for kernel 4.4.0-68

  You may need to install the following packages for this specific kernel:
    linux-tools-4.4.0-68-generic
    linux-cloud-tools-4.4.0-68-generic

  You may also want to install one of the following packages to keep up to date:
    linux-tools-generic
    linux-cloud-tools-generic

Revision history for this message
Carl Mueller (cmuell89) wrote :

Autotune with powertop works fine. No interference. Still showing heavy usage of C10 state when idling :) :)

I think this is a worthy path to incorporate for us 5520 users.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Thanks for your test! I'll backport this patch to Ubuntu Xenial's kernel.

From the log, I think your machine is preloaded with Ubuntu, right? It should come with TLP installed. TLP only enables runtime PM when power cord is unplugged, those "bad" should become "good" once the laptop run on battery.

Revision history for this message
Carl Mueller (cmuell89) wrote :

Kai-Feng, you were right about Powertop. I am a big fan of presuming th worst. For some reason, my trackpad stopped tracking (I could click but no movement). However upon restart it seems to be fully restored and operational.

Changed in linux (Ubuntu Xenial):
status: Incomplete → In Progress
assignee: nobody → Kai-Heng Feng (kaihengfeng)
Revision history for this message
Carl Mueller (cmuell89) wrote :

@Kai-Heng Feng, I am not sure if this patch was intended for 4.4.0-67 (which recently was updated via Software Updater) but that kernel version reverted my CPU behavior back to only using C3 states and nothing deeper. Just FYI.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

It should be included in version >= 4.4.0-68.

Revision history for this message
Carl Mueller (cmuell89) wrote :

Excuse my ignorance, but does that mean I should continue to use your 4.4.0-68 kernel and as Canonical releases kernel updates, I should naturally phase into the regular update stream again? Or should I revert to the newest updated (4.4.0-67) and remove your custom kernel?

Thanks!

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

You should remove the custom kernel and use the official Ubuntu kernel.

The deeper C state patch should be included soon.

Revision history for this message
Carl Mueller (cmuell89) wrote :

Kai-Heng Feng, I also noticed that by default the scaling driver used is acpi-cpufreq and not p-state. I've read that p-state is favorable for kernels >= 4.4. Is this something that is up to the user to decide or should this be considered an incorrect default?

analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 10.0 us.
  hardware limits: 800 MHz - 2.80 GHz
  available frequency steps: 2.80 GHz, 2.80 GHz, 2.70 GHz, 2.60 GHz, 2.40 GHz, 2.30 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.50 GHz, 1.40 GHz, 1.20 GHz, 1.10 GHz, 900 MHz, 800 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 800 MHz and 2.80 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 900 MHz (asserted by call to hardware).
  cpufreq stats: 2.80 GHz:2.85%, 2.80 GHz:0.00%, 2.70 GHz:0.25%, 2.60 GHz:0.64%, 2.40 GHz:0.65%, 2.30 GHz:1.42%, 2.00 GHz:2.07%, 1.90 GHz:1.27%, 1.80 GHz:1.64%, 1.70 GHz:3.14%, 1.50 GHz:3.57%, 1.40 GHz:5.39%, 1.20 GHz:6.85%, 1.10 GHz:13.39%, 900 MHz:29.31%, 800 MHz:27.53% (2074191)
  boost state support:
    Supported: yes
    Active: yes

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

You are right. Can you file another bug report?

Revision history for this message
Carl Mueller (cmuell89) wrote :
Brad Figg (brad-figg)
Changed in linux (Ubuntu Xenial):
status: In Progress → Fix Committed
Revision history for this message
Carl Mueller (cmuell89) wrote :

Fix not showing up in 4.4.0-70. Not sure if it was intended for this release.

Revision history for this message
Carl Mueller (cmuell89) wrote :

Fix not showing in 4.4.0-71 either. Just FYI in case it was intended.

Revision history for this message
Carl Mueller (cmuell89) wrote :
Download full text (3.4 KiB)

@Kai-Heng Feng, the fix is not showing up in 4.4.0-72

carl@carl-5520:~$ uname -a
Linux carl-5520 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

carl@carl-5520:~$ sudo powertop

          Package | Core | CPU 0 CPU 4
POLL 0.0% | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
C1 2.7% | C1 2.2% | C1 4.3% 1.3 ms 0.1% 0.3 ms
C2 7.3% | C2 7.3% | C2 7.0% 1.6 ms 7.7% 4.1 ms
C3 87.9% | C3 88.4% | C3 85.2% 14.8 ms 91.5% 23.1 ms

                    | Core | CPU 1 CPU 5
                    | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C1 2.6% | C1 0.0% 0.1 ms 5.2% 1.2 ms
                    | C2 4.4% | C2 2.8% 1.9 ms 6.1% 1.1 ms
                    | C3 91.3% | C3 96.0% 10.2 ms 86.6% 7.4 m

                    | Core | CPU 2 CPU 6
                    | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C1 5.1% | C1 8.8% 0.7 ms 1.4% 1.1 ms
                    | C2 8.4% | C2 14.7% 2.5 ms 2.1% 1.5 ms
                    | C3 84.6% | C3 73.7% 6.9 ms 95.4% 10.6 ms

                    | Core | CPU 3 CPU 7
                    | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C1 0.9% | C1 0.5% 0.2 ms 1.3% 3.3 ms
                    | C2 8.9% | C2 13.6% 1.6 ms 4.2% 2.5 ms
                    | C3 87.1% | C3 80.3% 6.8 ms 93.9% 10.8 ms

carl@carl-5520:~$ sudo i7z

Cpu speed from cpuinfo 2902.00Mhz
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc
Linux's inbuilt cpu_khz code emulated now
True Frequency (without accounting Turbo) 2902 MHz
  CPU Multiplier 29x || Bus clock frequency (BCLK) 100.07 MHz

Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]
  TURBO ENABLED on 4 Cores, Hyper Threading ON
  Max Frequency without considering Turbo 3002.07 MHz (100.07 x [30])
  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is 39x/37x/36x/35x
  Real Current Frequency 1395.28 MHz [100.07 x 13.94] (Max of below)
        Core [core-id] :Actual Freq (Mult.) C0% Halt(C1)% C3 % C6 % Temp VCore
        Core 1 [0]: 1351.45 (13.51x) 5.21 97.6 0 0 44 0.8995
        Core 2 [1]: 1395.28 (13.94x) 1.37 99.3 0 0 43 0.8981
        Core 3 [2]: 1310.44 (13.10x) 2.49 98.9 0 0 44 0.8981
        Core 4 [3]: 1328.40 (13.27x) 1 99.6 0 0 44 0.8954

C0 = Processor running without halting
C1 = Processor running with halts (States >C0 are power saver modes with cores idling)
C3 = Cores running with PLL turned off an...

Read more...

Revision history for this message
Carl Mueller (cmuell89) wrote :

Sorry to be so persistent but Intel has posted a warning about not using lower power states. See page 64 of this data sheet:

http://www.intel.com/content/www/us/en/processors/core/6th-gen-core-family-mobile-u-y-processor-lines-datasheet-vol-1.html

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

It's ok ;)

The new kernel in xenial-proposed should fix this issue.

Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-xenial' to 'verification-done-xenial'. If the problem still exists, change the tag 'verification-needed-xenial' to 'verification-failed-xenial'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-xenial
tags: added: verification-done-xenial
removed: verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (29.1 KiB)

This bug was fixed in the package linux - 4.4.0-75.96

---------------
linux (4.4.0-75.96) xenial; urgency=low

  * linux: 4.4.0-75.96 -proposed tracker (LP: #1684441)

  * [Hyper-V] hv: util: move waiting for release to hv_utils_transport itself
    (LP: #1682561)
    - Drivers: hv: util: move waiting for release to hv_utils_transport itself

linux (4.4.0-74.95) xenial; urgency=low

  * linux: 4.4.0-74.95 -proposed tracker (LP: #1682041)

  * [Hyper-V] hv: vmbus: Raise retry/wait limits in vmbus_post_msg()
    (LP: #1681893)
    - Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg()

linux (4.4.0-73.94) xenial; urgency=low

  * linux: 4.4.0-73.94 -proposed tracker (LP: #1680416)

  * CVE-2017-6353
    - sctp: deny peeloff operation on asocs with threads sleeping on it

  * vfat: missing iso8859-1 charset (LP: #1677230)
    - [Config] NLS_ISO8859_1=y

  * Regression: KVM modules should be on main kernel package (LP: #1678099)
    - [Config] powerpc: Add kvm-hv and kvm-pr to the generic inclusion list

  * linux-lts-xenial 4.4.0-63.84~14.04.2 ADT test failure with linux-lts-xenial
    4.4.0-63.84~14.04.2 (LP: #1664912)
    - SAUCE: apparmor: fix link auditing failure due to, uninitialized var

  * regession tests failing after stackprofile test is run (LP: #1661030)
    - SAUCE: fix regression with domain change in complain mode

  * Permission denied and inconsistent behavior in complain mode with 'ip netns
    list' command (LP: #1648903)
    - SAUCE: fix regression with domain change in complain mode

  * unexpected errno=13 and disconnected path when trying to open /proc/1/ns/mnt
    from a unshared mount namespace (LP: #1656121)
    - SAUCE: apparmor: null profiles should inherit parent control flags

  * apparmor refcount leak of profile namespace when removing profiles
    (LP: #1660849)
    - SAUCE: apparmor: fix ns ref count link when removing profiles from policy

  * tor in lxd: apparmor="DENIED" operation="change_onexec"
    namespace="root//CONTAINERNAME_<var-lib-lxd>" profile="unconfined"
    name="system_tor" (LP: #1648143)
    - SAUCE: apparmor: Fix no_new_privs blocking change_onexec when using stacked
      namespaces

  * apparmor oops in bind_mnt when dev_path lookup fails (LP: #1660840)
    - SAUCE: apparmor: fix oops in bind_mnt when dev_path lookup fails

  * apparmor auditing denied access of special apparmor .null fi\ le
    (LP: #1660836)
    - SAUCE: apparmor: Don't audit denied access of special apparmor .null file

  * apparmor label leak when new label is unused (LP: #1660834)
    - SAUCE: apparmor: fix label leak when new label is unused

  * apparmor reference count bug in label_merge_insert() (LP: #1660833)
    - SAUCE: apparmor: fix reference count bug in label_merge_insert()

  * apparmor's raw_data file in securityfs is sometimes truncated (LP: #1638996)
    - SAUCE: apparmor: fix replacement race in reading rawdata

  * unix domain socket cross permission check failing with nested namespaces
    (LP: #1660832)
    - SAUCE: apparmor: fix cross ns perm of unix domain sockets

  * Xenial update to v4.4.59 stable release (LP: #1678960)
    - xfrm: policy: init locks early
    - virtio_balloon: init ...

Changed in linux (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Carl Mueller (cmuell89) wrote :
Download full text (6.2 KiB)

Kernel 4.4.75 appears to have fixed the problem for C states.

          Package | Core | CPU 0 CPU 4
POLL 0.1% | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
C1E-SKL 1.4% | C1E-SKL 2.9% | C1E-SKL 3.5% 0.3 ms 2.3% 0.4 ms
C3-SKL 0.9% | C3-SKL 1.1% | C3-SKL 1.5% 0.2 ms 0.8% 0.2 ms
C6-SKL 8.4% | C6-SKL 12.6% | C6-SKL 19.0% 0.6 ms 6.1% 0.4 ms
C7s-SKL 0.2% | C7s-SKL 0.5% | C7s-SKL 0.6% 1.5 ms 0.3% 0.6 ms
C8-SKL 57.6% | C8-SKL 54.1% | C8-SKL 67.1% 1.7 ms 41.0% 3.2 ms
C9-SKL 0.0% | C9-SKL 0.0% | C9-SKL 0.0% 0.0 ms 0.0% 0.0 ms
C10-SKL 27.9% | C10-SKL 24.9% | C10-SKL 3.2% 4.4 ms 46.6% 8.0 ms

                    | Core | CPU 1 CPU 5
                    | POLL 0.4% | POLL 0.0% 0.0 ms 0.8% 3.7 ms
                    | C1E-SKL 1.4% | C1E-SKL 1.6% 0.2 ms 1.2% 0.4 ms
                    | C3-SKL 1.4% | C3-SKL 1.5% 0.3 ms 1.4% 0.8 ms
                    | C6-SKL 6.4% | C6-SKL 9.6% 0.6 ms 3.2% 0.5 ms
                    | C7s-SKL 0.1% | C7s-SKL 0.2% 0.4 ms 0.0% 0.0 ms
                    | C8-SKL 53.5% | C8-SKL 76.6% 2.4 ms 30.2% 2.4 ms
                    | C9-SKL 0.0% | C9-SKL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C10-SKL 33.5% | C10-SKL 7.2% 4.6 ms 59.6% 9.7 ms

                    | Core | CPU 2 CPU 6
                    | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C1E-SKL 0.6% | C1E-SKL 0.7% 0.1 ms 0.6% 0.2 ms
                    | C3-SKL 0.6% | C3-SKL 1.0% 0.2 ms 0.2% 0.1 ms
                    | C6-SKL 7.6% | C6-SKL 12.7% 0.5 ms 2.6% 0.7 ms
                    | C7s-SKL 0.0% | C7s-SKL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C8-SKL 63.6% | C8-SKL 81.4% 2.2 ms 45.6% 3.5 ms
                    | C9-SKL 0.0% | C9-SKL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C10-SKL 19.2% | C10-SKL 0.0% 0.0 ms 38.3% 4.8 ms

                    | Core | CPU 3 CPU 7
                    | POLL 0.0% | POLL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C1E-SKL 0.6% | C1E-SKL 1.0% 0.2 ms 0.2% 0.7 ms
                    | C3-SKL 0.5% | C3-SKL 0.8% 0.2 ms 0.2% 0.4 ms
                    | C6-SKL 6.4% | C6-SKL 12.4% 0.6 ms 0.5% 0.5 ms
                    | C7s-SKL 0.2% | C7s-SKL 0.0% 0.0 ms 0.4% 0.7 ms
                    | C8-SKL 56.6% | C8-SKL 72.6% 2.1 ms 40.5% 5.2 ms
                    | C9-SKL 0.0% | C9-SKL 0.0% 0.0 ms 0.0% 0.0 ms
                    | C10-SKL 32.8% | C10-SKL 10.0% 6.0 ms 55.5% 7.5 ms

carl@carl-5520:~$ sudo tlp stat -p
--- TLP 0.8 --------...

Read more...

Revision history for this message
Carl Mueller (cmuell89) wrote :
Download full text (3.5 KiB)

@Kai-Feng. The other bug regarding p-state as disappeared (I cannot access it on Ubuntu bugs). This bug also appears to be fixed as p-state is now the default scaling driver. However tlp stat is showing unusual max/min cpufreq settings after kernel installation. Do these settings seem incorrect and/or are they even used by the pstate driver?

$ sudo tlp-stat -p

--- TLP 0.8 --------------------------------------------

+++ Processor
CPU Model = Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz

/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 3900000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3900000 [kHz]

/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 3900000 [kHz]
/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3900000 [kHz]

/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 800000 [kHz]

/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 800000 [kHz]

/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 800000 [kHz]

/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 800000 [kHz]

/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3900000 [kHz]

/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 800000 [kHz]

/sys/devices/system/cpu/intel_pstate/min_perf_pct = 100
/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100
/sys/devices/system/cpu/intel_pstate/no_turbo = 0

x86_energy_perf_policy.cpu0 = powersave
x86_energy_perf_policy.cpu1 = powersave
x86_energy_perf_policy.cpu2 = powersave
x86_energy_perf_policy.cpu3 = powersa...

Read more...

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

It's at LP: #1674390.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Download full text (3.2 KiB)

@Carl, I burrowed a Precision 5520 and seems to be normal. Not sure what happened on your system...

--- TLP 0.8 --------------------------------------------

+++ Processor
CPU Model = Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz

/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3900000 [kHz]

/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3900000 [kHz]

/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3900000 [kHz]

/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3900000 [kHz]

/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3900000 [kHz]

/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3900000 [kHz]

/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3900000 [kHz]

/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz]
/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3900000 [kHz]

/sys/devices/system/cpu/intel_pstate/min_perf_pct = 20
/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100
/sys/devices/system/cpu/intel_pstate/no_turbo = 0

x86_energy_perf_policy.cpu0 = powersave
x86_energy_perf_policy.cpu1 = powersave
x86_energy_perf_policy.cpu2 = powersave
x86_energy_perf_policy.cpu3 = powersave
x86_energy_perf_policy.cpu4 = powersave
x86_energy_perf_policy.cpu5 = powersave
x86_energy_perf_policy.cpu6 = powersave
x86_energy_perf_policy.cpu7 = powe...

Read more...

Changed in linux (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.