Bug 20753 - xorg-server-1.5.3 high CPU usage
Summary: xorg-server-1.5.3 high CPU usage
Status: RESOLVED WONTFIX
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: http://bugs.gentoo.org/show_bug.cgi?i...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-19 12:14 UTC by Kadianakis George
Modified: 2009-05-14 06:04 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Possible fix (1.55 KB, patch)
2009-03-24 05:12 UTC, Michel Dänzer
no flags Details | Splinter Review
Possible fix which should even compile... (1.74 KB, patch)
2009-03-24 12:56 UTC, Michel Dänzer
no flags Details | Splinter Review
sysprof and oprofile outputs (90.75 KB, application/gzip)
2009-05-11 23:42 UTC, Kaido Kert
no flags Details

Description Kadianakis George 2009-03-19 12:14:56 UTC
Greetings,

this bug was first reported on the Gentoo bugzilla at:
http://bugs.gentoo.org/show_bug.cgi?id=262307

The problem is, that basically, from when I first upgraded to xorg-server-1.5.3 (mainly to use KDE4), X.org is causing high CPU load averages.

I notice lags when I switch application windows and if I check out top, I
usually get something like this:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 4241 root      20   0  239m  60m 4236 S   44  6.1  28:54.34 X

I'm using the intel driver, which I have recompiled for X.org
1.5.3.

I asked to provide a sysprof log of the problem and so I did at:
http://dev.gentoo.org/~asn/gentoo/sysprof.log
I opened a Firefox, an Amarok and an Akregator and I started playing around, opening tabs, checking out RSS feeds, browsing audio playlists etc. The results can be found if you load the sysprof.log file with sysprof ; )

Thanks!
Comment 1 Rémi Cardona 2009-03-19 12:50:41 UTC
Please attach the sysprof profile here directly. It'll make things easier for everybody.

Thanks
Comment 2 Kadianakis George 2009-03-19 13:19:08 UTC
(In reply to comment #1)
> Please attach the sysprof profile here directly. It'll make things easier for
> everybody.
> 
> Thanks
> 

The sysprof profile seems too big to be uploaded here. Specifically, it's filesize is 2.6MB and Freedesktop's Bugzilla complains on files bigger than 1MB :(
Comment 3 Rémi Cardona 2009-03-19 15:40:44 UTC
(In reply to comment #2)
> The sysprof profile seems too big to be uploaded here. Specifically, it's
> filesize is 2.6MB and Freedesktop's Bugzilla complains on files bigger than 1MB
> :(

Even gziped?
Comment 4 Kadianakis George 2009-03-19 15:59:56 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > The sysprof profile seems too big to be uploaded here. Specifically, it's
> > filesize is 2.6MB and Freedesktop's Bugzilla complains on files bigger than 1MB
> > :(
> 
> Even gziped?
> 

$ du -sh sysprof.log && tar cf toto.tar.gz sysprof.log && du -sh toto.tar.gz
2.6M    sysprof.log
2.6M    toto.tar.gz

:(
Comment 5 Michel Dänzer 2009-03-24 05:12:01 UTC
Created attachment 24190 [details] [review]
Possible fix

In the future, please

* Provide all the relevant information here directly, in particular Xorg.0.log
* Try to keep profiles focussed on a single operation as much as possible.

Anyway, the most likely problem here is that your hardware can't render to A8 pictures. Does this xserver patch help?
Comment 6 Kadianakis George 2009-03-24 12:21:55 UTC
(In reply to comment #5)
> Created an attachment (id=24190) [details]
> Possible fix
> 
> In the future, please
> 
> * Provide all the relevant information here directly, in particular Xorg.0.log
> * Try to keep profiles focussed on a single operation as much as possible.
> 
> Anyway, the most likely problem here is that your hardware can't render to A8
> pictures. Does this xserver patch help?
> 

I tried applying your patch against xorg-1.5.3 and xorg-1.6.0 but compilation dies with the following message:

exa_glyphs.c: In function ‘exaGlyphs’:
exa_glyphs.c:826: error: ‘pExaScr’ undeclared (first use in this function)
exa_glyphs.c:826: error: (Each undeclared identifier is reported only once
exa_glyphs.c:826: error: for each function it appears in.)
make[1]: *** [exa_glyphs.lo] Error 1
make[1]: Leaving directory `/var/tmp/portage/x11-base/xorg-server-1.6.0/work/xorg-server-1.6.0/exa'
make: *** [all-recursive] Error 1
Comment 7 Michel Dänzer 2009-03-24 12:56:26 UTC
Created attachment 24208 [details] [review]
Possible fix which should even compile...

Sorry, that version of the patch depended on another patch in my queue. Try this one.
Comment 8 Kadianakis George 2009-03-25 12:19:06 UTC
(In reply to comment #7)
> Created an attachment (id=24208) [details]
> Possible fix which should even compile...
> 
> Sorry, that version of the patch depended on another patch in my queue. Try
> this one.
> 

Yeah, that compiled correctly.
Unfortunately, I don't see any improvements. I'm getting the same lagging on window switching, the same old-responsiveness in various applications and the same old top output accusing X.org.

What's the chances that all the above are actually caused by the applications themselves?
Comment 9 Michel Dänzer 2009-03-26 01:40:35 UTC
(In reply to comment #8)
> Unfortunately, I don't see any improvements. I'm getting the same lagging on
> window switching, the same old-responsiveness in various applications and the
> same old top output accusing X.org.

You should get different profiles though, or the patch doesn't work as intended.


> What's the chances that all the above are actually caused by the applications
> themselves?

Pretty small I'm afraid, unless maybe you're using KDE4 compositing effects.
Comment 10 Kadianakis George 2009-03-26 12:35:17 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Unfortunately, I don't see any improvements. I'm getting the same lagging on
> > window switching, the same old-responsiveness in various applications and the
> > same old top output accusing X.org.
> 
> You should get different profiles though, or the patch doesn't work as
> intended.
> 

If you are referring to sysprof profiles, I just baked a new one for you.
It was made with a xorg-server-1.5.3 with your patch applied.

You can find it here:
http://dev.gentoo.org/~asn/gentoo/sysprof2.log

> > What's the chances that all the above are actually caused by the applications
> > themselves?
> 
> Pretty small I'm afraid, unless maybe you're using KDE4 compositing effects.
> 

I see. No, I am not using KDE4 compositing effects.
Comment 11 Michel Dänzer 2009-03-30 04:26:43 UTC
(In reply to comment #10)
> If you are referring to sysprof profiles, I just baked a new one for you.

Indeed I was, but unfortunately this doesn't seem to have any symbols for the X server process, so it's useless.
Comment 12 Kaido Kert 2009-05-11 23:42:10 UTC
Created attachment 25784 [details]
sysprof and oprofile outputs

Im getting similar performance issue, esp. when X has been running for a while, the lag gets worse and worse and X takes up increasingly more CPU.
Attached sysprof and oprof outputs, unfortunately sysprof does not want to pick up X symbols, even though i rebuilt and installed X with DEB_BUILD_OPTIONS="nostrip" and nm /usr/bin/X /usr/bin/Xorg lists all symbols

Anything else i can do to provide more info ? Im running Ubuntu Jaunty, stock xorg.conf.
Comment 13 Michel Dänzer 2009-05-12 07:35:02 UTC
(In reply to comment #12)
> Im getting similar performance issue, esp. when X has been running for a while,
> the lag gets worse and worse and X takes up increasingly more CPU.

Does it get better again after VT switching to console and back to X?

> Attached sysprof and oprof outputs, [...]

The oprofile doesn't seem to look similar to the original profiles here, so your problem should probably be tracked separately for now.

FWIW, the hot spots in your profile may have been improved in EXA in xserver Git (to become 1.7).
Comment 14 Kadianakis George 2009-05-12 07:48:03 UTC
Hello there again,

let me give you some updates regarding this bug report.
First of all, a while ago I encountered some hardware problems with my graphics card and I had to change it. I replaced it with an old ATI Radeon 9200 with the radeon open-source driver.
What I noticed is that things were going better. Not perfectly, but better. For example, Akregator would not lag so much when I switched to other feeds.

Like I said, there were still problems (X.org would still give me high CPU usage) and some days ago I decided to switch from KDE to see if that was to blame (top would also give me high CPU values for amarok). Right now, after a continuous hunt for the correct window manager, I'm with awesome.

Things are even better, and apart from some high CPU problems with firefox (taking around 40% CPU when I open new tabs or load urls from external applications, etc.), it's okay. Switching from application to application is effortless and I don't have drawing lags anymore.

X.org is at a stable 3.8% CPU usage at all times and I can't emulate the high CPU usage that I was having with KDE.
Comment 15 Michel Dänzer 2009-05-13 01:28:19 UTC
So, is there any point in keeping this report open? (BTW, the patch is in xserver Git and will be in the 1.7 release)
Comment 16 Kadianakis George 2009-05-13 09:19:19 UTC
(In reply to comment #15)
> So, is there any point in keeping this report open? (BTW, the patch is in
> xserver Git and will be in the 1.7 release)
> 

No, I guess there is no point in keeping this report open.

Please close it with any resolution you like :)

Thanks!


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.