GNOME Bugzilla – Bug 658228
GNOME shell is slow after screen lock / idle
Last modified: 2011-09-17 09:15:12 UTC
After locking the screen and/or being idle (monitor turns off), GNOME shell is really really slow. It uses 20% consistantly after I unlock the screen again. I've SSH'ed in from remote while the monitor is currently off, and noticed gnome-shell uses 100% CPU. In ~/.xsession-errors I see the following: (gnome-shell:29095): Clutter-CRITICAL **: clutter_actor_queue_relayout: assertion `CLUTTER_IS_ACTOR (self)' failed $ rpm -q gnome-shell gnome-shell-3.1.90.1-2.mga2 Random backtrace:
+ Trace 228336
I can also confirm this issue. Running top after the slowdown happens, I see the resource usage of GNOME Shell is increased (~190 MB resident memory, > 20% CPU usage on my computer). There is a noticeable latency while performing actions like moving windows and switching windows and workspaces. I also used the perf tool to generate these reports that might help: - Before slowdown (i.e. fresh restart of GNOME Shell): # Events: 2K cycles # # Overhead Command Shared Object Symbol # ........ ........... .................................. ................................ # 15.01% threaded-ml [ppdev] [k] 0xc102ce0e 12.03% threaded-ml libgobject-2.0.so.0.2990.0 [.] 0x337f2 8.96% threaded-ml libcogl.so.2.2.0 [.] 0x278a9 8.77% threaded-ml libc-2.13.so [.] 0x6d8b1 8.75% threaded-ml libglib-2.0.so.0.2990.0 [.] 0x6d04b 8.14% threaded-ml libclutter-glx-1.0.so.0.714.0 [.] 0x3f220 6.68% threaded-ml libmozjs185.so.1.0.0 [.] 0xa9891 4.65% threaded-ml libdricore.so [.] 0xe6c32 2.90% threaded-ml libgnome-shell.so [.] 0x3b46f 2.66% threaded-ml libgirepository-1.0.so.1.0.0 [.] 0xaa46 2.15% threaded-ml libcairo.so.2.11000.2 [.] 0x436e1 2.08% threaded-ml libpthread-2.13.so [.] pthread_mutex_lock 1.87% threaded-ml libgjs.so.0.0.0 [.] 0x1d901 1.81% threaded-ml libpthread-2.13.so [.] __pthread_mutex_unlock_usercnt 1.79% threaded-ml libmutter.so.0.0.0 [.] 0x2365b 1.38% threaded-ml i915_dri.so [.] 0x427d7 1.33% threaded-ml libgdk-3.so.0.118.0 [.] 0x494a3 0.96% threaded-ml ld-2.13.so [.] 0xe502 0.63% threaded-ml libpixman-1.so.0.20.2 [.] 0x3bcc1 0.60% threaded-ml libdrm_intel.so.1.0.0 [.] 0x69e7 0.56% threaded-ml libX11.so.6.3.0 [.] 0x37ce3 0.54% threaded-ml libpango-1.0.so.0.2903.0 [.] 0x10f81 - After slowdown (usually after resuming from suspend, or unlocking screen after the system's been idle): # Events: 5K cycles # # Overhead Command Shared Object Symbol # ........ ........... ................................................ ............................... # 67.43% threaded-ml libgdk-3.so.0.118.0 [.] 0x3d08d 4.80% threaded-ml [ppdev] [k] 0xc102ce0e 3.46% threaded-ml libmozjs185.so.1.0.0 [.] 0x11fa32 3.41% threaded-ml libgobject-2.0.so.0.2990.0 [.] 0x336e1 2.94% threaded-ml libglib-2.0.so.0.2990.0 [.] 0x132a0 2.85% threaded-ml libcogl.so.2.2.0 [.] 0x17361 2.83% threaded-ml libclutter-glx-1.0.so.0.714.0 [.] 0xbb4a1 2.42% threaded-ml libc-2.13.so [.] 0x7042b 1.91% threaded-ml libdricore.so [.] 0x71b01 1.74% threaded-ml libgnome-shell.so [.] 0x5cda1 0.79% threaded-ml i915_dri.so [.] 0x2cede 0.72% threaded-ml libgirepository-1.0.so.1.0.0 [.] 0x8c50 0.54% threaded-ml libpthread-2.13.so [.] pthread_mutex_lock 0.51% threaded-ml libgjs.so.0.0.0 [.] 0x1ae21
I use the nvidia driver. Also occurs with extremetuxracer (3D game). <magcius> so yes, it's not suspend/resume, it's unredirected windows
Created attachment 196326 [details] [review] MetaWindowActor: Make sure to always pop an error trap Here's the mismatched error trap...
Created attachment 196327 [details] [review] MetaWindowActor: Don't bother creating pixmaps for unredirected windows ... but why are we creating pixmaps for unredirected windows? Seems silly...
Created attachment 196329 [details] [review] MetaWindowActor: Delete useless error trap Actually, why not this? It doesn't seem like there's any X usage outside of that first trap (Clutter has its own traps, right?)
Created attachment 196407 [details] [review] meta-window-actor: Skip necessary steps in pre_paint We don't have to call check_needs_pixmap, check_needs_reshape and check_needs_shadow on unredirected windows, so skip that.
Review of attachment 196407 [details] [review]: ... Should have read the other patches before submitting anything.
Review of attachment 196407 [details] [review]: Sure.
Review of attachment 196326 [details] [review]: I like this approach better - knowing what exact error traps we need is *really* black art - depends on the exact details of GLX, refcounting inside cogl, etc. If we have something that works, leave it that way - the error traps aren't expensive if we nest them properly.
Review of attachment 196329 [details] [review]: As noted, don't feel this is safe
Review of attachment 196407 [details] [review]: Looks good to me too
Modified "Skip necessary steps" to "Skip unnecessary steps", otherwise pushes as is
Pushed the correct commits this time.
I tested this patch as a fix for https://bugzilla.gnome.org/show_bug.cgi?id=657869 . it semi-fixes that bug for me - it causes the screensaver/lock screen window to display correctly (instead of showing me my stale, pre-idle desktop), but doesn't cause the unlock dialog to appear. However, it *does* seem to cause Shell to crash, I think whenever I drag a window across the border between my two displays.
filed https://bugzilla.gnome.org/show_bug.cgi?id=658997 for the above crasher.
*** Bug 659297 has been marked as a duplicate of this bug. ***