You are not logged in.

#1 2018-03-04 09:07:51

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Lenovo X1 Carbon Gen6: CPU C states

Hi,

like in https://bbs.archlinux.org/viewtopic.php?id=234913 discovered, the CPU of the X1C6 doesn't enter C states below C3 in some cases.

Because I consider buying a X1C6, I would like to all if all of you are experiencing this issue. It seems like it works with kernel version 4.16, but can anyone approve this?

Thanks in advance!

Offline

#2 2018-03-04 18:05:27

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,539

Re: Lenovo X1 Carbon Gen6: CPU C states

Same issue -- I think fiji-flo may be doing something different, as he is reporting package state C8.
My cores are hitting C7, but the package only C2 and C3.

Just tested on 4.16 instead of 4.15, still the same.

Offline

#3 2018-03-04 21:25:00

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Re: Lenovo X1 Carbon Gen6: CPU C states

Maybe it has something to do with the 100% powertop usage of the USB device (https://bbs.archlinux.org/viewtopic.php … 7#p1771947)?

Last edited by johannesg00 (2018-03-04 21:25:19)

Offline

#4 2018-03-07 00:36:23

PastExcitement
Member
Registered: 2018-03-01
Posts: 21

Re: Lenovo X1 Carbon Gen6: CPU C states

After using `powertop --auto-tune` my X1C6 is getting into pc8 with the 4.15.7-1-ARCH kernel.

Offline

#5 2018-03-08 08:01:56

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: Lenovo X1 Carbon Gen6: CPU C states

I just tested Ubuntu 18.04 on my X1C6 and there I'm getting into pc10 sad

I'll try to figure out what's happening there.

Offline

#6 2018-03-08 08:42:57

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Re: Lenovo X1 Carbon Gen6: CPU C states

fiji-flo wrote:

I just tested Ubuntu 18.04 on my X1C6 and there I'm getting into pc10 sad

I'll try to figure out what's happening there.

Is S0i3 working with Ubuntu 18.04? See https://bbs.archlinux.org/viewtopic.php … 6#p1772666

Offline

#7 2018-03-08 09:33:59

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: Lenovo X1 Carbon Gen6: CPU C states

Here is a diff between configs of arch (15.6) and ubuntu 18.04 (15.0). To me, the most notable differences regarding CPU related options which show up in the Ubuntu config but not in arch are:

## What ubuntu kernel sets, which arch does not

CONFIG_NO_HZ_IDLE=y
CONFIG_SLUB_CPU_PARTIAL=y
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_HZ_250=y       # arch uses 1000hz
# CONFIG_PM_AUTOSLEEP is not set

I'm curious CONFIG_PM_AUTOSLEEP is actually not set in Ubuntu. Also, they use 250 ticks (as most distros do AFAIK). Moreover, I don't know a valid reason why arch doesn't define CONFIG_NO_HZ_IDLE. I'm compiling a new kernel with a few changes right now.

Last edited by esonn (2018-03-08 09:40:28)


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#8 2018-03-08 11:16:52

progandy
Member
Registered: 2012-05-17
Posts: 3,080

Re: Lenovo X1 Carbon Gen6: CPU C states

esonn wrote:

Moreover, I don't know a valid reason why arch doesn't define CONFIG_NO_HZ_IDLE.

Arch uses CONFIG_NO_HZ_FULL which does the same, but also allows skipping of ticks for cpus with only a single process.
https://www.kernel.org/doc/Documentatio … /NO_HZ.txt


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#9 2018-03-08 13:48:25

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: Lenovo X1 Carbon Gen6: CPU C states

progandy: Thanks, I already noticed they're mutually exclusive during configuration.

I'm now running a kernel with

CONFIG_NO_HZ_IDLE=y
CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_HZ_250=y
# CONFIG_PM_AUTOSLEEP is not yet

Yet, as before on my machine, I'm stuck on C8 and can't enter C9/C10 states.


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#10 2018-03-08 14:31:54

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Re: Lenovo X1 Carbon Gen6: CPU C states

esonn wrote:

I'm now running a kernel with

CONFIG_NO_HZ_IDLE=y
CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_HZ_250=y
# CONFIG_PM_AUTOSLEEP is not yet

Yet, as before on my machine, I'm stuck on C8 and can't enter C9/C10 states.

Have you tried booting to a tty or killing unneeded services? Maybe some process blocks entering the higher states?

Offline

#11 2018-03-08 14:56:57

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: Lenovo X1 Carbon Gen6: CPU C states

I always boot to tty and the only services running are the ones I need in any case (primarily wpa_supplicant, NetworkManager, dbus, polkit, avahi, sshd).

I just tested Ubuntu 18.04 on my X1C6 and there I'm getting into pc10 sad

fiji-flo: What about the c-states themselves?

As far as the package c-states are concerned, powertop shows me (output cropped):

            
C2 (pc2)    7.0%    
C3 (pc3)    0.3%    
C6 (pc6)    0.0%    
C7 (pc7)    0.4%    
C8 (pc8)   46.4%    
C9 (pc9)    0.0%    
C10 (pc10)  0.0%    

However, just looking at the c-states by core shows that all cores are mostly in C10 anyway:

# turbostat --show sysfs --quiet 
C1%   C1E%  C3%   C6%   C7s%  C8%   C9%   C10%
0.47  0.11  0.01  0.10  0.00  3.22  0.00  95.49
0.19  0.42  0.02  0.11  0.00  10.27 0.00  88.18
0.00  0.11  0.04  0.26  0.00  4.33  0.00  94.63
3.60  0.00  0.00  0.04  0.00  5.11  0.00  90.78
0.00  0.07  0.00  0.04  0.00  1.67  0.00  97.94
0.00  0.00  0.00  0.00  0.00  1.00  0.00  98.36
0.00  0.02  0.02  0.20  0.00  1.54  0.00  97.76
0.00  0.00  0.00  0.09  0.00  1.07  0.00  97.75
0.00  0.27  0.00  0.09  0.00  0.80  0.00  98.49

I don't get why the "package" can't agree to go beyond PC8 collectively, even though C10 is obviously used heavily (unless I miss something here).


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#12 2018-03-08 15:43:27

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Re: Lenovo X1 Carbon Gen6: CPU C states

Maybe there was a change between the kernel versions 4.15.0 and 4.15.6 which broke the sleep states or Ubuntu has specific patches?

Offline

#13 2018-03-08 16:27:25

progandy
Member
Registered: 2012-05-17
Posts: 3,080

Re: Lenovo X1 Carbon Gen6: CPU C states

These two patches might be relevant. The mei patch is upstream since v4.16-rc1, but not any v4.15 version.
Edit: It is already in v4.15.1. I must have missed it when I rechecked my git clone. cherry-picked commits are evil.

http://kernel.ubuntu.com/git/ubuntu/ubu … 42a28e8829
http://kernel.ubuntu.com/git/ubuntu/ubu … fb18164792

Last edited by progandy (2018-03-08 17:09:53)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#14 2018-03-08 16:52:42

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: Lenovo X1 Carbon Gen6: CPU C states

I agree especially for the first one. However, it is already included in 15.6-ARCH as Linus included it in the vanilla kernel - just confirmed it on my machine.

The second one, however, isn't (the comments only refer to backlight problems, though).


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#15 2018-03-08 16:57:01

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: Lenovo X1 Carbon Gen6: CPU C states

I can't enter pc10 on v4.15 either.

I also build 4.16rc4 with the Ubuntu 18.04 kernel config -> Didn't help.

I was browsing the Ubuntu custom patches but I didn't see something interesting so far.

I guess my next step is build 4.15 from the Ubuntu tree and see if that helps.

esonn: the (CPU) c-states go down to C10.

Offline

#16 2018-03-08 18:11:54

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: Lenovo X1 Carbon Gen6: CPU C states

Turning off the screen sends my machine to PC9 (while another terminal ran powertop), only one more to go wink

xset dpms force off && sleep 1m && xset dpms force on

leads to

C9 (pc9)   53.0%

Last edited by esonn (2018-03-08 18:14:52)


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#17 2018-03-08 19:19:15

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Re: Lenovo X1 Carbon Gen6: CPU C states

Does anybody know if microcode updates are enables by default in Ubuntu?

Offline

#18 2018-03-08 21:03:11

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: Lenovo X1 Carbon Gen6: CPU C states

Yeah turning off the screen got me even to pc10. I would guess it's i915 issue then (the GPU probably belong to the "package"). I'll play around with parameters.

C2 (pc2)    6.5%
C3 (pc3)    2.2%
C6 (pc6)    4.4%
C7 (pc7)    0.8%
C8 (pc8)   46.5%
C9 (pc9)    0.7%
C10 (pc10)  4.1% 

I compiled the Ubuntu kernel sources for my arch. Didn't help sad
So GPU is a fair chance for now.

Offline

#19 2018-03-09 06:23:00

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Re: Lenovo X1 Carbon Gen6: CPU C states

fiji-flo wrote:

Yeah turning off the screen got me even to pc10. I would guess it's i915 issue then (the GPU probably belong to the "package"). I'll play around with parameters.

C2 (pc2)    6.5%
C3 (pc3)    2.2%
C6 (pc6)    4.4%
C7 (pc7)    0.8%
C8 (pc8)   46.5%
C9 (pc9)    0.7%
C10 (pc10)  4.1% 

Are these values from Arch or Ubuntu? Have you tried i915 power saving kernel parameters, e.g. rc6?

In a Reddit thread (https://www.reddit.com/r/thinkpad/comme … and_linux/) somebody posted a powertop screenshot of the T480s with similar hardware (https://i.imgur.com/8kTWetJ.png). It seems like this laptop has no troubles entering pc10.

Offline

#20 2018-03-09 06:58:41

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: Lenovo X1 Carbon Gen6: CPU C states

This was on Arch.

On Ubuntu is see pc10 even with the display turned on.

Offline

#21 2018-03-09 07:32:23

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: Lenovo X1 Carbon Gen6: CPU C states

This is on Arch:

          Package   |             Core    |            CPU 0       CPU 4
Powered On  0.0%    | POLL        0.0%    | POLL        0.0%    0.0 ms  0.0%    0.0 ms
C1E         1.0%    | C1E         1.4%    | C1E         0.6%    1.1 ms  2.1%    2.9 ms
                    |                     |
C3          0.2%    | C3          0.4%    | C3          0.6%    1.6 ms  0.1%    0.4 ms
RC6pp       0.0%    | C6          2.2%    | C6          2.2%    1.0 ms  2.3%    0.8 ms
C7s         0.0%    | C7s         0.1%    | C7s         0.1%    1.9 ms  0.1%    1.0 ms
C8         21.4%    | C8         21.6%    | C8         19.6%    3.9 ms 23.6%    4.0 ms
C9          0.0%    | C9          0.0%    | C9          0.0%    0.6 ms  0.0%    1.3 ms
C10        69.9%    | C10        68.0%    | C10        72.6%   11.3 ms 63.3%   10.0 ms

All a matter of perception I guess. After all my kernel rebuilding and digging I thought I should double check how I measure this. Turns out powertop-2.8 (shipped with Ubuntu 16.04 & 18.04) says I'm in C10 whereas powertop-2.9 (Arch default) says C8.

Offline

#22 2018-03-09 08:27:05

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: Lenovo X1 Carbon Gen6: CPU C states

Wow, that was unexpected. According the powertop-2.9 release notes, kaby lake support actually started with 2.9, so my guess would be the 2.8 results are simply not trustworthy. I did a git log v2.9..HEAD on the repo, but none of the commits show anything relevant for the X1 CPUs.


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#23 2018-03-09 10:35:54

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: Lenovo X1 Carbon Gen6: CPU C states

Lenovo released a new BIOS version, which brings UEFI from 1.08 -> 1.12. Changelog apprently doesn't address Linux-related issues however.

Last edited by esonn (2018-03-09 10:38:30)


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#24 2018-03-09 16:37:49

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Re: Lenovo X1 Carbon Gen6: CPU C states

Has anybody tried compiling powertop 2.9 for Ubuntu?

Offline

#25 2018-03-09 18:12:19

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Re: Lenovo X1 Carbon Gen6: CPU C states

pc10 isn't working on the T480s either, see https://www.reddit.com/r/thinkpad/comme … ux/dvfxhw5

Offline

Board footer

Powered by FluxBB