After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 658228 - GNOME shell is slow after screen lock / idle
GNOME shell is slow after screen lock / idle
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.1.x
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 659297 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-05 07:59 UTC by Olav Vitters
Modified: 2011-09-17 09:15 UTC
See Also:
GNOME target: 3.2
GNOME version: ---


Attachments
MetaWindowActor: Make sure to always pop an error trap (1.17 KB, patch)
2011-09-13 03:03 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
MetaWindowActor: Don't bother creating pixmaps for unredirected windows (839 bytes, patch)
2011-09-13 03:03 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
MetaWindowActor: Delete useless error trap (1.01 KB, patch)
2011-09-13 03:25 UTC, Jasper St. Pierre (not reading bugmail)
rejected Details | Review
meta-window-actor: Skip necessary steps in pre_paint (1.11 KB, patch)
2011-09-13 16:07 UTC, drago01
committed Details | Review

Description Olav Vitters 2011-09-05 07:59:17 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:
  • #0 delete_outdated_error_traps
    at gdkdisplay-x11.c line 2396
  • #1 gdk_x11_display_error_trap_push
    at gdkdisplay-x11.c line 2435
  • #2 gdk_error_trap_push
    at gdkdisplay.c line 2058
  • #3 meta_window_actor_pre_paint
    from /usr/lib64/libmutter.so.0
  • #4 ??
    from /usr/lib64/libmutter.so.0
  • #5 _clutter_actor_get_paint_volume_real
    at ./clutter-actor.c line 12183
  • #6 _clutter_actor_get_paint_volume_mutable
    at ./clutter-actor.c line 12259
  • #7 clutter_actor_get_transformed_paint_volume
    at ./clutter-actor.c line 12343
  • #8 clutter_group_real_get_paint_volume
    at ./clutter-group.c line 408
  • #9 _clutter_actor_get_paint_volume_real
    at ./clutter-actor.c line 12183
  • #10 _clutter_actor_get_paint_volume_mutable
    at ./clutter-actor.c line 12259
  • #11 _clutter_actor_update_last_paint_volume
    at ./clutter-actor.c line 2661
  • #12 clutter_actor_paint
    at ./clutter-actor.c line 2943
  • #13 g_list_foreach
    at glist.c line 938
  • #14 clutter_group_real_paint
    at ./clutter-group.c line 281
  • #15 g_closure_invoke
    at gclosure.c line 774
  • #16 signal_emit_unlocked_R
    at gsignal.c line 3310
  • #17 g_signal_emit_valist
    at gsignal.c line 3003
  • #18 g_signal_emit
    at gsignal.c line 3060
  • #19 clutter_actor_continue_paint
    at ./clutter-actor.c line 3025
  • #20 clutter_actor_paint
    at ./clutter-actor.c line 2967
  • #21 g_list_foreach
    at glist.c line 938
  • #22 clutter_group_real_paint
    at ./clutter-group.c line 281
  • #23 clutter_stage_paint
    at ./clutter-stage.c line 635
  • #24 g_closure_invoke
    at gclosure.c line 774
  • #25 signal_emit_unlocked_R
    at gsignal.c line 3310
  • #26 g_signal_emit_valist
    at gsignal.c line 3003
  • #27 g_signal_emit
    at gsignal.c line 3060
  • #28 clutter_actor_continue_paint
    at ./clutter-actor.c line 3025
  • #29 clutter_actor_paint
    at ./clutter-actor.c line 2967
  • #30 _clutter_stage_do_paint
    at ./clutter-stage.c line 575
  • #31 clutter_stage_cogl_redraw
    at cogl/clutter-stage-cogl.c line 430
  • #32 clutter_stage_do_redraw
    at ./clutter-stage.c line 1024
  • #33 _clutter_stage_do_update
    at ./clutter-stage.c line 1080
  • #34 clutter_clock_dispatch
    at ./clutter-master-clock.c line 384
  • #35 g_main_dispatch
    at gmain.c line 2442
  • #36 g_main_context_dispatch
    at gmain.c line 3011
  • #37 g_main_context_iterate
    at gmain.c line 3089
  • #38 g_main_loop_run
    at gmain.c line 3297
  • #39 meta_run
    from /usr/lib64/libmutter.so.0
  • #40 main
    at main.c line 560

Comment 1 MT 2011-09-11 10:03:45 UTC
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
Comment 2 Olav Vitters 2011-09-12 21:05:08 UTC
I use the nvidia driver.

Also occurs with extremetuxracer (3D game).

<magcius> so yes, it's not suspend/resume, it's unredirected windows
Comment 3 Jasper St. Pierre (not reading bugmail) 2011-09-13 03:03:18 UTC
Created attachment 196326 [details] [review]
MetaWindowActor: Make sure to always pop an error trap

Here's the mismatched error trap...
Comment 4 Jasper St. Pierre (not reading bugmail) 2011-09-13 03:03:54 UTC
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...
Comment 5 Jasper St. Pierre (not reading bugmail) 2011-09-13 03:25:37 UTC
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?)
Comment 6 drago01 2011-09-13 16:07:50 UTC
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.
Comment 7 drago01 2011-09-13 16:08:47 UTC
Review of attachment 196407 [details] [review]:

... Should have read the other patches before submitting anything.
Comment 8 Jasper St. Pierre (not reading bugmail) 2011-09-13 16:31:51 UTC
Review of attachment 196407 [details] [review]:

Sure.
Comment 9 Owen Taylor 2011-09-13 17:36:29 UTC
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.
Comment 10 Owen Taylor 2011-09-13 17:36:53 UTC
Review of attachment 196329 [details] [review]:

As noted, don't feel this is safe
Comment 11 Owen Taylor 2011-09-13 17:37:07 UTC
Review of attachment 196407 [details] [review]:

Looks good to me too
Comment 12 Jasper St. Pierre (not reading bugmail) 2011-09-13 17:41:32 UTC
Modified "Skip necessary steps" to "Skip unnecessary steps", otherwise pushes as is
Comment 13 Jasper St. Pierre (not reading bugmail) 2011-09-13 17:43:46 UTC
Pushed the correct commits this time.
Comment 14 Adam Williamson 2011-09-13 22:20:22 UTC
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.
Comment 15 Adam Williamson 2011-09-13 23:03:48 UTC
filed https://bugzilla.gnome.org/show_bug.cgi?id=658997 for the above crasher.
Comment 16 drago01 2011-09-17 09:15:12 UTC
*** Bug 659297 has been marked as a duplicate of this bug. ***