Performance drop after suspend/resume cycle

Bug #671932 reported by Øyvind Stegard on 2010-11-06
This bug affects 12 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
nvidia-graphics-drivers (Ubuntu)

Bug Description

A slight but noticable drop in graphics performance can be observed after a single suspend/resume cycle in the latest -proposed kernel in Ubuntu Lucid (2.6.32-26). I haven't tested if the problem is more general, or if it only applies to graphics operations.

glxgears numbers before first suspend:
18494 frames in 5.0 seconds
16493 frames in 5.0 seconds
16521 frames in 5.0 seconds
17073 frames in 5.0 seconds
18495 frames in 5.0 seconds

glxgears again under exactly same conditions after a single suspend/resume:
15517 frames in 5.0 seconds
15672 frames in 5.0 seconds
15684 frames in 5.0 seconds
15687 frames in 5.0 seconds
15680 frames in 5.0 seconds

I know glxgears isn't a proper benchmarking tool, but the point here is the *relative* decrease in performance. The performance drop is also noticable when for instance browsing web pages in Firefox.

This is a regression, kernel 2.6.32-25 in Lucid does *not* have this problem.

Using nvida driver 195.36.24.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: linux-image-2.6.32-26-generic 2.6.32-26.46 [modified: lib/modules/2.6.32-26-generic/kernel/drivers/input/mouse/psmouse.ko]
Regression: Yes
Reproducible: Yes
ProcVersionSignature: Ubuntu 2.6.32-26.46-generic
Uname: Linux 2.6.32-26-generic x86_64
NonfreeKernelModules: nvidia
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
 **** List of PLAYBACK Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
Architecture: amd64
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 /dev/snd/controlC0: oyvind 1661 F.... pulseaudio
CRDA: Error: [Errno 2] No such file or directory
 Card hw:0 'Intel'/'HDA Intel at 0xd9660000 irq 22'
   Mixer name : 'IDT 92HD81B1C5'
   Components : 'HDA:111d76d5,1028040b,00100104'
   Controls : 14
   Simple ctrls : 9
 Card hw:1 'NVidia'/'HDA NVidia at 0xd3080000 irq 16'
   Mixer name : 'Nvidia ID b'
   Components : 'HDA:10de000b,10de0101,00100100'
   Controls : 0
   Simple ctrls : 0

Date: Sat Nov 6 20:40:07 2010
HibernationDevice: RESUME=UUID=983c04ad-2482-46a9-8cea-257feca98e75
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
MachineType: Dell Inc. Latitude E6510
 Socket 0:
   no product info available
 Socket 0:
   no card
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.32-26-generic root=UUID=4626d257-a6a0-44b7-98e2-fd554a191b29 ro quiet splash
 PATH=(custom, user)
RelatedPackageVersions: linux-firmware 1.34.1
SourcePackage: linux 08/10/2010
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A05 0N5KHN
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 9
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvrA05:bd08/10/2010:svnDellInc.:pnLatitudeE6510:pvr0001:rvnDellInc.:rn0N5KHN:rvrA00:cvnDellInc.:ct9:cvr: Latitude E6510
dmi.product.version: 0001
dmi.sys.vendor: Dell Inc.

Øyvind Stegard (oyvinst) wrote :
Øyvind Stegard (oyvinst) wrote :

I doesn't happen consistently after every suspend/resume. The first sign of problems is slow redraw when the screen is first unlocked after a resume.

[There is a known issue with the nvidia-driver which results in slow scrolling in Firefox on particularly, because of software fallbacks being triggered in Xorg. That's a different issue, but the slowdown sometimes occuring in 2.6.32-26 after suspend/resume makes this issue much worse, with extreme lags when Xorg is using 100% CPU.]

Øyvind Stegard (oyvinst) wrote :

I have not been able to reproduce this problem with mainline kernel stable release (2.6.32-02063225 from mainline kernel PPA). I have no idea what might cause it to happen with 2.6.32-26 in -proposed; there are unfortunately no relevant error messages.

Øyvind Stegard (oyvinst) wrote :

Update: it does occur with mainline as well. Perhaps some scheduling issue ? However, the Maverick 2.6.35 kernel backported to Lucid seems fine (provided one uses the "acpi=nonvs" workaround to prevent suspend/resume from failing completely).

Øyvind Stegard (oyvinst) wrote :

Now also observed with kernel 2.6.35. Probably some nvidia issue hooray, marking invalid..

Changed in linux (Ubuntu):
status: New → Invalid
Øyvind Stegard (oyvinst) wrote :

A work-around mentioned by others in possibly related nvidia bug reports (bug 656279) is to disable hyperthreading processors before suspending and re-enable them after resume. That actually works for this problem as well. The slow performance after resume is gone.

I put the following script into /etc/pm/sleep.d/ :

# Disable hyper-threading processor cores on suspend and hibernate, re-enable them
# on resume. Presumably helps for buggy nvidia or kernel behaviour.
# This file goes into /etc/pm/sleep.d/

case $1 in
  echo 0 > /sys/devices/system/cpu/cpu1/online
  echo 0 > /sys/devices/system/cpu/cpu3/online

  echo 1 > /sys/devices/system/cpu/cpu1/online
  echo 1 > /sys/devices/system/cpu/cpu3/online

Of course, the script needs to be adapted according to CPU type of the target system, or improved to just autodetect all hyper-threading processors. I have a Core i7 with two real cores(proc id 0 and 2) and two hyper-threading cores (proc id 1 and 3).

danielmewes (danielmewes) wrote :

Øyvind, thank you for that script. The graphics performance issue after suspend was bugging me for quite a while (up to a degree where it was considerably less fun to use my PC) and the disabling HT cores (+ reenabling them afterwards) instantly fixes the issue for me! :-)
I am using an HP Elitebook 8440p with an NVIDIA Quadro NVS 3100M by the way. Ubuntu 10.04, 64 Bit.

JorgeAzevedo (cenomail) wrote :

Øyvind, thank you so much for the script. I was experiencing this issue on Ubuntu 10.04 with the latest nvidia drivers from x-swat updates (270.29-0ubuntu1~lucid~xup2) and the latest kernel from the kernel team ppa (2.6.38-8-generic-pae) on a macbookpro from April 2010, and it works greats.

Just a note, don't forget to add the executable permission with

sudo chmod +x /etc/pm/sleep.d/

Soenke (s0enke) wrote :

As #656279 was marked as "fixed released" I think the duplicate state of this report is wrong because the bug described here is still alive. Upstream bug report:

boomtopper (boomtopper) wrote :

Frustratingly enough I've still got this too. Running a W510 with Natty.
I've also tried other distros and OpenSuse has it also but Fedora doesn't though.

lordzet (ryszka3) wrote :

The proposed workaround doesn't fully work for me - re-enabling the HT cores after resuming freezes my laptop (Samsung RF510), the numlock diode start to blink. I had to remove the power cord to shut it down.

Changed in nvidia-graphics-drivers (Ubuntu):
status: New → Confirmed
dino99 (9d9) wrote :

That version is no more supported; please open a new bug report if the actual archive found version also has the same issue.

Changed in nvidia-graphics-drivers (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers