Slow performance after resuming from/on battery (CPUs do not scale above 800MHz) with intel_pstate

Bug #1497520 reported by Daniel Hahler
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Medium
Unassigned

Bug Description

I have noticed slow performance after resuming from STR on battery.

I can not trigger this always, but it seems to be related to suspending and resuming while on battery.

The CPU scaling governors look like this then:

% cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
powersave
performance
performance
performance

% cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
intel_pstate
intel_pstate
intel_pstate
intel_pstate

% cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
3200000
3200000
3200000
3200000

When watching the current CPU frequencies, it can be seen that they don't go above 800000 ('watch grep \"cpu MHz\" /proc/cpuinfo').

I cannot see why they are limited to 800000.

It looks like https://bugzilla.kernel.org/show_bug.cgi?id=61241, but /sys/devices/system/cpu/intel_pstate/max_perf_pct is at 100.

Just writing the same setting for cpu0 again fixes it, and all CPUs will be scaled above 800MHz again:

% echo powersave | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: linux-image-3.19.0-28-generic 3.19.0-28.30
ProcVersionSignature: Ubuntu 3.19.0-28.30-generic 3.19.8-ckt5
Uname: Linux 3.19.0-28-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.4
Architecture: amd64
CurrentDesktop: Unity
Date: Sat Sep 19 10:39:02 2015
HibernationDevice: RESUME=UUID=d39463f5-889e-42ba-a729-f3f442f0c8dd
InstallationDate: Installed on 2012-05-28 (1208 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
MachineType: LENOVO 42992PG
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-3.19.0-28-generic root=/dev/mapper/vg0-rootlv ro quiet splash
RelatedPackageVersions:
 linux-restricted-modules-3.19.0-28-generic N/A
 linux-backports-modules-3.19.0-28-generic N/A
 linux-firmware 1.143.3
SourcePackage: linux
UpgradeStatus: Upgraded to vivid on 2015-05-14 (127 days ago)
dmi.bios.date: 05/14/2015
dmi.bios.vendor: LENOVO
dmi.bios.version: 8DET70WW (1.40 )
dmi.board.asset.tag: Not Available
dmi.board.name: 42992PG
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr8DET70WW(1.40):bd05/14/2015:svnLENOVO:pn42992PG:pvrThinkPadX220Tablet:rvnLENOVO:rn42992PG:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 42992PG
dmi.product.version: ThinkPad X220 Tablet
dmi.sys.vendor: LENOVO

Revision history for this message
Daniel Hahler (blueyed) wrote :
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
penalvch (penalvch) wrote : Re: Slow performance after resuming from/on battery (CPUs do not scale above 800MHz)

Daniel Hahler, thank you for reporting this and helping make Ubuntu better. Could you please test the latest upstream kernel available from the very top line at the top of the page from http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D (the release names are irrelevant for testing, and please do not test the daily folder)? Install instructions are available at https://wiki.ubuntu.com/Kernel/MainlineBuilds . This will allow additional upstream developers to examine the issue.

If the latest kernel did not allow you to test to the issue (ex. you couldn't boot into the OS) please make a comment in your report about this, and continue to test the next most recent kernel version until you can test to the issue. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this issue is fixed in the mainline kernel, please add the following tags by clicking on the yellow circle with a black pencil icon, next to the word Tags, located at the bottom of the report description:
kernel-fixed-upstream
kernel-fixed-upstream-X.Y-rcZ

Where X, Y, and Z are numbers corresponding to the kernel version.

If the mainline kernel does not fix the issue, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-X.Y-rcZ

Please note, an error to install the kernel does not fit the criteria of kernel-bug-exists-upstream.

Once testing of the latest upstream kernel is complete, please mark this report's Status as Confirmed. Please let us know your results.

Thank you for your understanding.

tags: added: latest-bios-1.40
Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Revision history for this message
Daniel Hahler (blueyed) wrote :

I could not trigger it using the upstream kernel for now (4.3.0-040300rc1-generic).

But it's maybe noteworthy, that the governors of CPU 1-3 get changed from "powersave" to "performance", regardless of using the Ubuntu or upstream kernel (/sys/devices/system/cpu/cpu*/cpufreq/scaling_governor).
That might be related to /etc/init.d/ondemand somehow, from Ubuntu's sysvinit package.

I am going to tag it as fixed upstream, but that's only from two tests, and I have not found a reliable way to trigger this before already.

tags: added: kernel-fixed-upstream
tags: added: kernel-fixed-upstream-4.3-rc1
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

Daniel Hahler, please feel free to stress test it for longer if it's intermittent, to better confirm your initial results.

Revision history for this message
Doug Smythies (dsmythies) wrote :

To the best of my knowledge, this specific (resume from suspend, intel_pstate, performance mode) issue has been fixed in the upstream kernel. However, I never understood this issue to be specific to battery mode, an interesting twist.

Note that there are other issues, and sometimes it is hard to separate the issues and they tend to cross contaminate these bug reports.

See also:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1484587/comments/5

Revision history for this message
Daniel Hahler (blueyed) wrote :

Thanks a lot for this insights, Doug!

I really think it is related to battery mode, but I cannot say that it has to be on battery before suspend and/or during resume really. It's just that I've noticed this issue to pop up when suspending on battery.
It might be even be only / more related to suspending to RAM vs. to disk.

Changed in linux (Ubuntu):
status: Confirmed → Triaged
summary: Slow performance after resuming from/on battery (CPUs do not scale above
- 800MHz)
+ 800MHz) with intel_pstate
Revision history for this message
penalvch (penalvch) wrote :

Daniel Hahler, did you confirm that the quoted commit does indeed fix your issue?

Changed in linux (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Daniel Hahler (blueyed) wrote :

> did you confirm that the quoted commit does indeed fix your issue?

No, I am not building Linux from source currently, and have not tried e.g. applying that patch/commit to the Ubuntu package.

I am now back using the Ubuntu kernel, since the workaround is trivial in case it is required - once you know what the issue is about.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Christopher, please change the status back to Confirmed/Triaged, according to my feedback.

Revision history for this message
penalvch (penalvch) wrote :

Daniel Hahler, could you please test the patch to confirm it actually fixes your issue? Instructions may be found at https://wiki.ubuntu.com/Kernel/KernelBisection#Testing_a_newly_released_patch_from_upstream .

Revision history for this message
Doug Smythies (dsmythies) wrote :

For your Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz processor, what is the normal minimum pstate? I ask because I have only seen on battery power resume from suspend issues that are related to Clock Modulation becoming enabled. i.e. I am wondering if 800MHz is a normal minimum frequency or below the normal minimum.

One way, would be to do:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq
1600000
1600000
1600000
1600000
1600000
1600000
1600000
1600000

and you can see that on my computer ( Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz ), the minimum pstate is 16.

I'm not sure yet if our issues are related, but on my computer, I also am seeing odd stuff on resume from suspend (I didn't used to), but my CPU frequencies are not stuck low, but rather never go below pstate 24, even though the driver is asking for lower. I also get the same lack of restoring the proper governor on all the CPUs except CPU 0 (and note that for an S3 suspend CPU 0 is the one that never goes off line).

Example (no load):

pstate being asked for:

# rdmsr --bitfield 15:8 -d -a 0x199
16
16
16
16
16
16
16
16

pstate that I am getting:

# rdmsr --bitfield 15:8 -d -a 0x198
24
24
24
24
24
24
24
24

CPU freqs:

# grep MHz /proc/cpuinfo
cpu MHz : 2400.054
cpu MHz : 2399.921
cpu MHz : 2399.921
cpu MHz : 2399.921
cpu MHz : 2399.789
cpu MHz : 2399.789
cpu MHz : 2399.921
cpu MHz : 2399.921

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
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.