Bug 208191 - low PCx residency: Thinkpad X1 Yoga gen 4: low battery life
Summary: low PCx residency: Thinkpad X1 Yoga gen 4: low battery life
Status: NEEDINFO
Alias: None
Product: Power Management
Classification: Unclassified
Component: Run-Time-PM (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Zhang Rui
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-15 17:37 UTC by Nate Graham
Modified: 2023-02-07 18:47 UTC (History)
4 users (show)

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


Attachments
Fully idle (5.39 KB, text/plain)
2020-06-30 20:27 UTC, Nate Graham
Details
Idle with apps open (5.42 KB, text/plain)
2020-06-30 20:29 UTC, Nate Graham
Details
turbostat output again (5.39 KB, text/plain)
2020-11-03 02:10 UTC, Nate Graham
Details
New turbostat output with screen off (5.47 KB, text/plain)
2020-12-04 18:35 UTC, Nate Graham
Details

Description Nate Graham 2020-06-15 17:37:15 UTC
My new Thinkpad X1 Yoga gen 4 gets very poor battery life with kernel 5.6.14 on openSUSE Tumbleweed with KDE Plasma 5.19: about 4 hours of battery life when performing low intensity use (some web browsing and text editing), while in windows, reviews claim that it gets at least 7 hours in Windows.

Powertop shows that the machine draws between 8 and 10 watts at idle and 12-13 with light use (we browsing, some text editing). It reports that the display backlight uses 10 watts of power at full brightness, 5 watts when at its lowest level, and 4 watts when turned off entirely, which seems wrong, or much too high if it's correct.

The bottom of the case is always warm, so perhaps the CPU is also not idling enough.

I don't know what kind of logging to collect and provide, but I can do so if directed to.
Comment 1 alexgallotta 2020-06-16 07:16:16 UTC
I had same issues with several machines (3+).
I would suggest to:
1- check the cpu usage with top/htop
2- check the working frequency of processes with "cat /proc/cpuinfo|grep MHz"
3- check at "sensors" output (lm-sensors package)

if 1 shows no core with high cpu, it might be 2. If that is the case, I resolved using "powersave" governor/energy policies (used by TLP).

Another option could be if you use a dedicated GPU, trying to disable it and use only integrated graphic
Comment 2 alexgallotta 2020-06-16 07:19:40 UTC
P.S.
clarification on 2: it seems that using a performance/balanced governor on intel cpu with turbo boost, the cpu's are all running at very high freq even if processes are not requiring them.
For example in my machine with Processors: 8 × Intel® Core™ i7-8565U CPU @ 1.80GHz
I usually run with all cores at 900 MHz with low load, and go up to 4200+ MHz when cpu intensive tasks are running.
I have a 74w battery and can use laptop for web browsing for 12+ hours
Comment 3 Zhang Rui 2020-06-30 07:16:30 UTC
(In reply to alexgallotta from comment #1)
> I had same issues with several machines (3+).

Please file separate bugs for those issues. We will focus on one issue in one platform for each bug report.


> I would suggest to:
> 1- check the cpu usage with top/htop
> 2- check the working frequency of processes with "cat /proc/cpuinfo|grep MHz"
> 3- check at "sensors" output (lm-sensors package)
> 
> if 1 shows no core with high cpu, it might be 2. If that is the case, I
> resolved using "powersave" governor/energy policies (used by TLP).
> 
> Another option could be if you use a dedicated GPU, trying to disable it and
> use only integrated graphic
Comment 4 Zhang Rui 2020-06-30 07:17:33 UTC
(In reply to Nate Graham from comment #0)
> My new Thinkpad X1 Yoga gen 4 gets very poor battery life with kernel 5.6.14
> on openSUSE Tumbleweed with KDE Plasma 5.19: about 4 hours of battery life
> when performing low intensity use (some web browsing and text editing),
> while in windows, reviews claim that it gets at least 7 hours in Windows.
> 
> Powertop shows that the machine draws between 8 and 10 watts at idle and
> 12-13 with light use (we browsing, some text editing). It reports that the
> display backlight uses 10 watts of power at full brightness, 5 watts when at
> its lowest level, and 4 watts when turned off entirely, which seems wrong,
> or much too high if it's correct.
> 
> The bottom of the case is always warm, so perhaps the CPU is also not idling
> enough.
> 
> I don't know what kind of logging to collect and provide, but I can do so if
> directed to.

please attach the output of "turbostat -o ts.out sleep 60" when the system is idle.
please run powertop --auto-tune and then attach the output of "turbostat -o ts-after-auto-tune.out sleep 60" when the system is idle.
Comment 5 Nate Graham 2020-06-30 20:27:42 UTC
Created attachment 289983 [details]
Fully idle

Thanks. I had already run `powertop--auto-tune` in the past and running it again produces only the following:

modprobe cpufreq_stats failedLoaded 440 prior measurements
RAPL device for cpu 0
RAPL Using PowerCap Sysfs : Domain Mask f
RAPL device for cpu 0
RAPL Using PowerCap Sysfs : Domain Mask f
Devfreq not enabled
glob returned GLOB_ABORTED
Leaving PowerTOP

So consider these attachments to be post-powertop data, I suppose.

First attachment: system idle, unplugged, no apps open, 80% screen brightness
Comment 6 Nate Graham 2020-06-30 20:29:22 UTC
Created attachment 289985 [details]
Idle with apps open

Second attachment: system idle and unplugged but with all my typical apps open (Dolphin, Konsole, Kate, Firefox, Thunderbird, Telegram, Riot, Discord) and me not using them at all, 80% screen brightness
Comment 7 Nate Graham 2020-06-30 20:30:19 UTC
Let me know if I can provide any more information.
Comment 8 Nate Graham 2020-10-12 00:32:30 UTC
I believe the requested information was provided and I am still experiencing the issue. Can someone move this out of the NEEDINFO status? Thanks!
Comment 9 Zhang Rui 2020-11-03 01:32:51 UTC
All the CPUs have 90%+ CC10 residency, but we only get 30%+ PC8, this surely sounds like a problem, and it indeed hurts the battery life of this laptop.
please try power-top --auto-tune first, and then re-get the idle turbostat output.
Comment 10 Nate Graham 2020-11-03 02:05:59 UTC
I have already done `power-top --auto-tune`, and idle turbostat output can be found at https://bugzilla.kernel.org/show_bug.cgi?id=209617#c4.
Comment 11 Nate Graham 2020-11-03 02:10:34 UTC
Created attachment 293409 [details]
turbostat output again

Did it again for fun. Ran `sudo powertop--auto-tune` and then immediately ran `sudo turbostat -o ts-idle.out sleep 60`
Comment 12 Zhang Rui 2020-11-26 07:17:02 UTC
@wendy, can we know what blocks runtime PC10?
Comment 13 wendy.wang 2020-12-01 14:42:32 UTC
Hi Graham,

ts-idle.log shows the deepest Pkg c-state is 56% PC8 residency during idle is not good.
My suggestion

1. It's better to double check the Pkg cstate with screen off scenario:

powertop --auto-tune // which is used to enable all the pci devices runtime suspend setting 

DISPLAY:=0.0

sleep 30; xset dpms force off ; sleep 10 ; turbostat -o ts.log sleep 30 ;xset dpms force on

2. If screen off scenario also shows pc8 residency only, then let's check GFX DMC FW. (If screen off shows deeper Pkg-cstate, then we need to talk to gfx team)

cat /sys/kernel/debug/dri/0/i915_dmc_info

Make sure DMC FW is loaded (and there is no newer DMC version error message in dmesg: dmesg | grep -i DMC ), and check if DC5 and DC6 have values. If the DC5 value always shows zero during idle—though the platform display supports Panel Self Refresh (PSR) and the latest DMC firmware is loaded— this means there may be something wrong with the graphics driver. 

3. If latest DMC FW is loaded, and DC5/DC6 has non-zero value, then check  Devices LTR values. We can try to ignore all the devices LTR value by command:
for i in {0..20}; do echo $i  > /sys/kernel/debug/pmc_core/ltr_ignore; done

4. If LTR does not help as well, another suggestion is to check PCIe Link Power State, but which is rely on other tool.

5. Last suggestion: always try with the latest BIOS and kernel version.
Comment 14 Nate Graham 2020-12-04 18:35:02 UTC
Created attachment 293933 [details]
New turbostat output with screen off

> sudo cat /sys/kernel/debug/dri/0/i915_dmc_infofw loaded: yes
path: i915/kbl_dmc_ver1_04.bin
version: 1.4
DC3 -> DC5 count: 4628
DC5 -> DC6 count: 4248
program base: 0x09004040
ssp base: 0x00002fc0
htp: 0x00b40068

> Make sure DMC FW is loaded
> dmesg | grep -i DMC
732:[    3.487125] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)


How do I check Devices LTR or PCIe Link Power State?


I am using the latest BIOS offered by Lenovo through fwupd. Current kernel version is 5.9.10
Comment 15 Zhang Rui 2021-03-19 07:53:05 UTC
I see PC10 residency now, although we don't have S0ix residency.
so is there any improvement?
Comment 16 Nate Graham 2021-03-19 17:30:51 UTC
Yes, I'm using Kernel 5.11.4 now, and battery life has improved a bit, but I still wouldn't call it amazing. Low intensity endurance is up to about 5.5 hours, which is better than before, but not up to the 7+ I get on Windows.
Comment 17 Zhang Rui 2021-04-26 02:54:19 UTC
So we only got less than 40% PC10 residency at runtime, and that is probably why you can not get longer battery life.

TBH, we don't have a BKM for runtime PC10/s0ix residency tuning.

If there is still a problem in freeze mode, then Wendy has a BKM that might help in this case, 
https://01.org/blogs/qwang59/2020/linux-s0ix-troubleshooting

But still, TBH, this also depends, we don't know how far we can go on this specific platform.
Comment 18 Zhang Rui 2021-04-26 03:01:23 UTC
I will see if we have a Dell 9500 internally that I can get access, if yes, I will give the feedback later.
Comment 19 alexwriter 2023-02-07 18:47:16 UTC
[    3.334797] i8042: [0] 20 -> i8042 (command)
[    3.335528] i8042: [0] 65 <- i8042 (return)
[    3.335588] i8042: [0] 20 -> i8042 (command)
[    3.336310] i8042: [1] 65 <- i8042 (return)
[    3.336322] i8042: [1] 60 -> i8042 (command)
[    3.336631] i8042: [1] 74 -> i8042 (parameter)
[    3.336768] i8042: [1] d3 -> i8042 (command)
[    3.336896] i8042: [1] 5a -> i8042 (parameter)
[    3.337033] i8042: [1] 5a <- i8042 (return)
[    3.337038] i8042: [1] a7 -> i8042 (command)
[    3.337162] i8042: [1] 20 -> i8042 (command)
[    3.337474] i8042: [1] 74 <- i8042 (return)
[    3.337479] i8042: [1] a8 -> i8042 (command)
[    3.338021] i8042: [1] 20 -> i8042 (command)
[    3.338333] i8042: [1] 54 <- i8042 (return)
[    3.338365] i8042: [1] 60 -> i8042 (https://essayservice.io/)
[    3.338911] i8042: [1] 56 -> i8042 (parameter)
[    3.339095] i8042: [1] d3 -> i8042 (command)
[    3.339225] i8042: [2] a5 -> i8042 (parameter)
[    3.612694] i8042: [84]      -- i8042 (aux irq test timeout)
[    3.612774] i8042: [84] a5 <- i8042 (flush, aux)
[    3.612788] i8042: [84] 60 -> i8042 (command)
[    3.613283] i8042: [84] 74 -> i8042 (parameter)
[    3.613483] i8042: [84] 60 -> i8042 (command)
[    3.613610] i8042: [84] 65 -> i8042 (parameter)
[    3.613616] serio: i8042 KBD port at 0x60,0x64 irq 1
[    3.621824] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2

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