Bug 19675

Summary: perfomance degrades on subsequent restarts of xserver
Product: xorg Reporter: Peter <pva>
Component: Driver/intelAssignee: Jesse Barnes <jbarnes>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: infinity80, remi
Version: 7.4 (2008.09)Keywords: NEEDINFO
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 20570    
Bug Blocks:    
Attachments:
Description Flags
Xorg.0.log-good
none
Xorg.0.log-bad
none
dmegs
none
sysprof-good
none
sysprof-bad none

Description Peter 2009-01-21 08:01:41 UTC
Created attachment 22131 [details]
Xorg.0.log-good

If X server (with compiz as window manager) is started after full reboot everything works fine. But after I exit my X session and start it another time performance degrades: cube rotation in compiz became not smooth, windows resize take long time. This is the difference between two Xorg.0.log files for cases when I had good and bad performance:

--- Xorg.0.log-good        2009-01-21 18:49:16.000000000 +0300
+++ Xorg.0.log-bad         2009-01-21 18:49:58.000000000 +0300
@@ -223,12 +223,12 @@
 (II) LoadModule: "ramdac"
 (II) Module "ramdac" already built-in
 (II) intel(0): Comparing regs from server start up to After PreInit
-(WW) intel(0): Register 0x61200 (PP_STATUS) changed from 0xd0000009 to 0xd000000a
-(WW) intel(0): PP_STATUS before: on, ready, sequencing on
+(WW) intel(0): Register 0x61200 (PP_STATUS) changed from 0xc0000008 to 0xd000000a
+(WW) intel(0): PP_STATUS before: on, ready, sequencing idle
 (WW) intel(0): PP_STATUS after: on, ready, sequencing on
-(WW) intel(0): Register 0x71024 (PIPEBSTAT) changed from 0x00000206 to 0x80000000
+(WW) intel(0): Register 0x71024 (PIPEBSTAT) changed from 0x00000206 to 0x80000206
 (WW) intel(0): PIPEBSTAT before: status: VSYNC_INT_STATUS SVBLANK_INT_STATUS VBLANK_INT_STATUS
-(WW) intel(0): PIPEBSTAT after: status: FIFO_UNDERRUN
+(WW) intel(0): PIPEBSTAT after: status: FIFO_UNDERRUN VSYNC_INT_STATUS SVBLANK_INT_STATUS VBLANK_INT_STATUS
 (==) Depth 24 pixmap format is 32 bpp
 (II) do I need RAC?  No, I don't.
 (II) resource ranges after preInit:

I have:
x11-base/xorg-server-1.5.3-r1
x11-drivers/xf86-video-intel-2.5.1-r1
media-libs/mesa-7.2
x11-libs/libdrm-2.4.4
kernel is 2.6.28 with the following two patches:
http://git.kernel.org/?p=linux/kernel/git/anholt/drm-intel.git;a=commitdiff_plain;h=9f4f07ceb1716d8796089fcef91621c5f07c872a
http://git.kernel.org/?p=linux/kernel/git/anholt/drm-intel.git;a=commitdiff_plain;h=e1a6fcee467556a7e955fe1f7ccc134dd2f974e7
Comment 1 Peter 2009-01-21 08:02:11 UTC
Created attachment 22132 [details]
Xorg.0.log-bad
Comment 2 Peter 2009-01-21 08:05:08 UTC
Created attachment 22133 [details]
dmegs

dmesg output.

Note on first start there could be no "mtrr: no MTRR for e0000000,10000000 found" message. But I have experience that even *with* this message in log performance is good and the contents of /proc/mtrr is always same and does not changes:

reg00: base=0x07e000000 ( 2016MB), size=   32MB, count=1: uncachable
reg01: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back
reg02: base=0x07d700000 ( 2007MB), size=    1MB, count=1: uncachable
reg03: base=0x07d800000 ( 2008MB), size=    8MB, count=1: uncachable
Comment 3 Gordon Jin 2009-02-03 17:45:35 UTC
Please provide profile (with sysprof).
Comment 4 Peter 2009-02-05 09:06:21 UTC
Created attachment 22616 [details]
sysprof-good
Comment 5 Peter 2009-02-05 09:06:41 UTC
Created attachment 22617 [details]
sysprof-bad
Comment 6 Peter 2009-02-05 09:09:12 UTC
Ok, this are two profiles. Good was taken when everything worked good and bad when everythings worked bad. In both cases I've started sysprof and then did more or less similar actions, in which slowness is best visible.
Comment 7 Uros 2009-02-05 14:24:24 UTC
Sorry for not noticing this before, but I have exact same problem on similar hardware and libdrm-2.4.4 @ http://bugs.freedesktop.org/show_bug.cgi?id=19963
Comment 8 Peter 2009-03-09 01:30:12 UTC
I'll try to elaborate on mtrr a bit more (update on comment #2)

 1. On first start there is no 'mtrr: no MTRR for e0000000,10000000 found' message in dmesg. Performance is perfect.
 2. After first restart I see this message, but performance still perfect. 
 3. On second restart there is another mtrr message (third start) and I see performance degrades...

Currently I've updated to:
x11-base/xorg-server-1.5.3-r3
x11-drivers/xf86-video-intel-2.6.3
media-libs/mesa-7.3
x11-libs/libdrm-2.4.5

So this is most recent software.

I've gathered another sysprof messages, after start of server (1. step mentioned before): http://theor.ran.gpi.ru/sysprof-good , after restart (step 2.): http://theor.ran.gpi.ru/sysprof-good-mtrr and after another restart (step 2.): http://theor.ran.gpi.ru/sysprof-bad

This bug is perfectly reproducible. Are there any ideas what can cause this issue? I've tried to boot with disable_mtrr_cleanup but with no luck so probably mtrr has nothing to do with this issue. What else should I try? Please suggest.
Comment 9 Jesse Barnes 2009-03-30 17:21:06 UTC
Yeah this is pretty weird.  The profiles don't have symbol info for X or the kernel so they're not that helpful...

Does the same problem happen with UXA?  In theory the memory manager should be taken down when X exits, but kernel physical memory will be more fragmented over time.  I don't know why that would cause huge perf. decline for you though.

What about if you disable render accel (option "exanocomposite" "true" in the intel driver section of your xorg.conf)?  Maybe something in the render setup is accumulating?
Comment 10 Jesse Barnes 2009-05-04 14:53:55 UTC
Any update here Peter?  Still see issues with the latest bits?  Did you see my last update?
Comment 11 Peter 2009-05-09 03:19:41 UTC
(In reply to comment #10)
> Any update here Peter?  Still see issues with the latest bits?  Did you see my
> last update?

Jesse, unfortunately currently I'm unable to start fusion-icon at all due to bug 21639. I'll check next time I manage to start compiz.
Comment 12 Uros 2009-06-16 04:12:04 UTC
*** Bug 19963 has been marked as a duplicate of this bug. ***
Comment 13 Uros 2009-06-16 04:24:36 UTC
Upgraded to:
x11-base/xorg-server-1.6.1.901-r3
x11-drivers/xf86-video-intel-2.7.1
media-libs/mesa-7.4.2
x11-libs/libdrm-2.4.11
sys-kernel/gentoo-sources-2.6.30-r1

Also I enabled KMS and switched to UXA acceleration.

Seems to be working now without degradation on X restart / suspend-to-ram.
Comment 14 Jesse Barnes 2009-06-16 09:59:28 UTC
Great, thanks for the update.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.