X frequently freezes for couple of minutes when backlight is turned back on and gnome3 locked deskto

Hi,

For a couple of months I’ve been having an issue with my Dell XPS 17 notebook (with a nVidia GT555M) which initially was running on Fedora 18 x86_64, GNOME 3.6 and the RPMFusion nVidia drivers. Some days ago I updated to Fedora 19/rawhide with the 313.18 nVidia driver but the problems also exists there.

Once my notebook has become inactive for a couple of minutes it will automatically turn off the backlight and lock the desktop. When I move the mouse or press any key the backlight turns back on and I’m asked to enter my password to unlock the desktop.

This works fine for most of the time, but it happens frequently that the backlight gets turned back on and I can see the GNOME unlock/login dialog but X itself directly becomes unresponsive. This also includes all input from the mouse and the keyboard.

In this situation even requests to switch VT’s (CTRL+ALT+F2 for example) don’t get processed.

Most of the time X automatically gets back to live after a couple of minutes doing nothing. All queued input events (for example key presses) will then also be processed.

This issue can occur when only the internal notebook display is used or when both the internal display and an external monitor are enabled

When X is frozen it is still possible to connect to the notebook in question using SSH. While connected using SSH I could run various diagnostic tools to find out more about the situation.

  • When running top it shows multiple ‘kmigration’ processes which are claiming a lot of CPU
  • There are no noticeable user-space processes with high CPU usage (everything is < 1% CPU)

While running strace on the Xorg process it seems to wait on a ioctl call to the nVidia kernel module to complete:

strace -f -p pidof Xorg

Process 862 attached
ioctl(10, 0xc0384641 <keeps on waiting here>

lsof -p pidof Xorg | grep 10u

Xorg    862 root   10u      CHR            195,255      0t0      18766 /dev/nvidiactl

This can also be observed when a gstack is run:

gstack pidof Xorg

#0  0x00000036468ec337 in ioctl () at …/sysdeps/unix/syscall-template.S:81
#1  0x00007f34f0b3b84c in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
#2  0x00007f34f0b3e7dc in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
#3  0x00007f34f0f95a0c in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
#4  0x00007f34f0f95ab3 in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
#5  0x00007f34f0f9c82f in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
#6  0x00007f34f0f9cb63 in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
#7  0x0000000000485750 in xf86Wakeup ()
#8  0x000000000043ac6d in WakeupHandler ()
#9  0x0000000000465b3f in WaitForSomething ()
#10 0x00000000004366e1 in Dispatch ()
#11 0x00000000004261c5 in main ()

When a kernel CPU stack trace is generated (echo l > /proc/sysrq-trigger) it shows that all my CPU’s are idle except for two, the first one is the request to create a kernel CPU stack trace and the other one shows Xorg with nVidia traces:

Feb 16 13:57:55 erik-laptop kernel: [ 3845.961249] NMI backtrace for cpu 4
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961254] CPU 4
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961262] Pid: 862, comm: Xorg Tainted: PF          O 3.8.0-0.rc4.git1.1.fc19.x86_64 #1 Dell Inc.          Dell System XPS L702X/03RG89
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961265] RIP: 0010:[<ffffffffa08427c0>]  [<ffffffffa08427c0>] os_free_spinlock+0x10/0x10 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961432] RSP: 0018:ffff8804140a9a58  EFLAGS: 00000286
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961436] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961439] RDX: 0000000000000000 RSI: ffff88041427ad48 RDI: ffff8804239fc9c8
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961442] RBP: ffff88041427ad20 R08: ffff88041427ad54 R09: 0000000000000000
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961445] R10: ffffffffa0b76b40 R11: 0000000000000000 R12: 000000000000035e
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961448] R13: ffff88041427ad54 R14: ffff88041427ad48 R15: 0000000000409b00
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961452] FS:  00007f34f1f54980(0000) GS:ffff88043e100000(0000) knlGS:0000000000000000
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961455] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000000000000
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961459] CR2: 00007fdcd31c0000 CR3: 000000040d70f000 CR4: 00000000000407e0
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961462] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961465] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000000
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961469] Process Xorg (pid: 862, threadinfo ffff8804140a8000, task ffff88041405aec0)
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961471] Stack:
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961474]  ffffffffa0816d36 ffff8804234ca008 ffffffffa03a058a ffff8804140a9a80
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961480]  0000000000000000 ffff88041427ad48 ffff88041427ad54 0000000000000000
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961487]  ffffffffa03a0668 ffff88041427ade4 ffff880413139308 ffff8804234ca008
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961493] Call Trace:
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961642]  [<ffffffffa0816d36>] ? _nv011803rm+0x9/0xe [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961787]  [<ffffffffa03a058a>] ? _nv014975rm+0xdb/0x17a [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.961930]  [<ffffffffa03a0668>] ? _nv014976rm+0x3f/0x78 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.962256]  [<ffffffffa0667aef>] ? _nv013506rm+0x98a/0x170b [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.962573]  [<ffffffffa065fe37>] ? _nv003192rm+0x491b/0xb118 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.962810]  [<ffffffffa0711f14>] ? _nv010389rm+0x20a/0x30c [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.963041]  [<ffffffffa071799a>] ? _nv003212rm+0x167a/0x16fe [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.963273]  [<ffffffffa070df92>] ? _nv010679rm+0x33f/0x385 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.963509]  [<ffffffffa04a7a6c>] ? _nv004294rm+0x4ba/0xb02 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.963741]  [<ffffffffa04a9cc0>] ? _nv003807rm+0x183/0x23c [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.964010]  [<ffffffffa052f52a>] ? _nv003843rm+0xaeb4/0xf320 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.964275]  [<ffffffffa052f48e>] ? _nv003843rm+0xae18/0xf320 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.964537]  [<ffffffffa0533980>] ? _nv003843rm+0xf30a/0xf320 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.964799]  [<ffffffffa053418a>] ? _nv003745rm+0x16c/0x6c5 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.964940]  [<ffffffffa039a412>] ? _nv013328rm+0x6e/0x74 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.965079]  [<ffffffffa0399767>] ? _nv013851rm+0x1187/0x11d8 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.965217]  [<ffffffffa0399d30>] ? _nv013350rm+0x578/0x5a6 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.965355]  [<ffffffffa0399d6d>] ? _nv000741rm+0xf/0x14 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.965484]  [<ffffffffa038014a>] ? _nv000695rm+0x31/0x59 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.965639]  [<ffffffffa081372d>] ? _nv000789rm+0x98d/0x9ee [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.965783]  [<ffffffffa081be39>] ? rm_ioctl+0x76/0x100 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.965923]  [<ffffffffa083849f>] ? nv_kern_ioctl+0x13f/0x470 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.966060]  [<ffffffffa08387f1>] ? nv_kern_unlocked_ioctl+0x21/0x30 [nvidia]
Feb 16 13:57:55 erik-laptop kernel: [ 3845.966069]  [<ffffffff811aea59>] ? do_vfs_ioctl+0x99/0x580
Feb 16 13:57:55 erik-laptop kernel: [ 3845.966079]  [<ffffffff81299c8a>] ? inode_has_perm.isra.31.constprop.61+0x2a/0x30
Feb 16 13:57:55 erik-laptop kernel: [ 3845.966086]  [<ffffffff8129b057>] ? file_has_perm+0x97/0xb0
Feb 16 13:57:55 erik-laptop kernel: [ 3845.966094]  [<ffffffff811aefd1>] ? sys_ioctl+0x91/0xb0
Feb 16 13:57:55 erik-laptop kernel: [ 3845.966102]  [<ffffffff81655599>] ? system_call_fastpath+0x16/0x1b
Feb 16 13:57:55 erik-laptop kernel: [ 3845.966105] Code: 9b a0 bf 04 00 00 00 31 c0 e8 0d f4 ff ff 5b 44 89 e0 41 5c 5d c3 0f 1f 00 00 00 00 00 00 00 00 55 48 89 e5 e8 e2 ef ff ff 5d c3 <66> 00 00 00 00 00 00 00 e5 53 48 89 fb e8 ce a7 e0 e0 48 89 43

When a complete kernel stack trace is generated (echo t > /proc/sysrq-trigger) then the following processes with nVidia frames can be observed:

Feb 16 13:54:06 erik-laptop kernel: [ 3616.690085] kworker/4:0     S ffff88043e113d80     0  1928      2 0x00000080
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690089]  ffff8803e1597e28 0000000000000000 ffff8803f0564620 ffff8803e1597fd8
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690095]  ffff8803e1597fd8 ffff8803e1597fd8 ffff880423094620 ffff8803f0564620
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690101]  ffffffffa0841d40 ffff880423313d80 ffff88043e10e490 0000000000000000
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690107] Call Trace:
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690249]  [<ffffffffa0841d40>] ? os_alloc_semaphore+0x90/0x90 [nvidia]
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690256]  [<ffffffff8164be09>] schedule+0x29/0x70
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690261]  [<ffffffff8107cd5a>] worker_thread+0x21a/0x450
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690267]  [<ffffffff8107cb40>] ? busy_worker_rebind_fn+0x110/0x110
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690274]  [<ffffffff81081d60>] kthread+0xc0/0xd0
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690280]  [<ffffffff810decdc>] ? __audit_syscall_exit+0x20c/0x2c0
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690288]  [<ffffffff81010000>] ? ftrace_define_fields_xen_mc_entry+0x30/0xf0
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690295]  [<ffffffff81081ca0>] ? kthread_create_on_node+0x120/0x120
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690301]  [<ffffffff816554ec>] ret_from_fork+0x7c/0xb0
Feb 16 13:54:06 erik-laptop kernel: [ 3616.690308]  [<ffffffff81081ca0>] ? kthread_create_on_node+0x120/0x120

Feb 16 13:54:06 erik-laptop kernel: [ 3616.691258] kworker/6:0     S ffff88043e193d80     0  2316      2 0x00000080
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691263]  ffff880426063e28 0000000000000000 ffff8803f6e58000 ffff880426063fd8
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691269]  ffff880426063fd8 ffff880426063fd8 ffff880426962ec0 ffff8803f6e58000
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691275]  ffffffffa0841d40 ffff880414308800 ffff88043e18e490 0000000000000000
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691281] Call Trace:
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691418]  [<ffffffffa0841d40>] ? os_alloc_semaphore+0x90/0x90 [nvidia]
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691424]  [<ffffffff8164be09>] schedule+0x29/0x70
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691429]  [<ffffffff8107cd5a>] worker_thread+0x21a/0x450
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691435]  [<ffffffff8107cb40>] ? busy_worker_rebind_fn+0x110/0x110
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691442]  [<ffffffff81081d60>] kthread+0xc0/0xd0
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691449]  [<ffffffff81010000>] ? ftrace_define_fields_xen_mc_entry+0x30/0xf0
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691456]  [<ffffffff81081ca0>] ? kthread_create_on_node+0x120/0x120
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691461]  [<ffffffff816554ec>] ret_from_fork+0x7c/0xb0
Feb 16 13:54:06 erik-laptop kernel: [ 3616.691468]  [<ffffffff81081ca0>] ? kthread_create_on_node+0x120/0x120

Does this give you enough information to continue investigating this issue?