Screen freeze if gnome-shell allocates page fault in Wayland mode
Affected version
- Your OS and version
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
- Affected Mutter version
$ dpkg -l | grep mutter
ii gir1.2-mutter-10:amd64 42.4-0ubuntu0.22.04.1 amd64 GObject introspection data for Mutter
ii libmutter-10-0:amd64 42.4-0ubuntu0.22.04.1 amd64 window manager library from the Mutter window manager
ii libmutter-10-0-dbgsym:amd64 42.4-0ubuntu0.22.04.1 amd64 debug symbols for libmutter-10-0
ii libmutter-10-dev:amd64 42.4-0ubuntu0.22.04.1 amd64 Development files for the Mutter window manager
ii libmutter-test-10:amd64 42.4-0ubuntu0.22.04.1 amd64 Test helper library for GNOME's window manager library
ii libmutter-test-10-dbgsym:amd64 42.4-0ubuntu0.22.04.1 amd64 debug symbols for libmutter-test-10
ii mutter 42.4-0ubuntu0.22.04.1 amd64 Example window manager using GNOME's window manager library
ii mutter-10-tests 42.4-0ubuntu0.22.04.1 amd64 Tests for GNOME's window manager library
ii mutter-10-tests-dbgsym 42.4-0ubuntu0.22.04.1 amd64 debug symbols for mutter-10-tests
ii mutter-common 42.4-0ubuntu0.22.04.1 all shared files for the Mutter window manager
ii mutter-dbgsym 42.4-0ubuntu0.22.04.1 amd64 debug symbols for mutter
- Does this issue appear in XOrg and/or Wayland
Wayland only
Bug summary
Screen freeze when gnome-shell failed to request memory
Steps to reproduce
- stress-ng --stack 0 --timeout 30 # over ssh or making timeout less than 20 to prevent systemd-oomd kills gnome-shell or turn-off systemd-oomd
- in my experience, it can be reproduced within 3 times of step.1
What happened
Screen freeze, the mutter is waiting for syncobj.
What did you expect to happen
gnome-shell back to work after memory stress
Relevant logs, screenshots, screencasts etc.
- mutter is waiting for syncobj (
DRM_IOCTL_SYNCOBJ_WAIT
)
(gdb) bt
#0 __GI___ioctl (fd=19, request=3223348419) at ../sysdeps/unix/sysv/linux/ioctl.c:36
#1 0x00007f3796b76b3f in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
#2 0x00007f3796bf3d0b in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
#3 0x00007f379646df49 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
#4 0x00007f3796158e64 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
#5 0x00007f3796159b00 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
#6 0x00007f379615ad55 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
#7 0x00007f37ab02eb90 in cogl_gl_timestamp_query_get_time_ns (context=<optimized out>, query=<optimized out>) at ../cogl/cogl/driver/gl/cogl-util-gl.c:548
#8 0x00007f37ab06a1b9 in cogl_frame_info_get_rendering_duration_ns (info=info@entry=0x565185028540) at ../cogl/cogl/cogl-frame-info.c:133
#9 0x00007f37ab6459e4 in frame_cb (onscreen=<optimized out>, frame_event=<optimized out>, user_data=0x56518477a0f0, frame_info=0x565185028540) at ../src/backends/meta-stage-view.c:79
#10 frame_cb (onscreen=<optimized out>, frame_event=<optimized out>, frame_info=0x565185028540, user_data=0x56518477a0f0) at ../src/backends/meta-stage-view.c:43
#11 0x00007f37ab0637a2 in notify_event (info=0x565185028540, event=COGL_FRAME_EVENT_COMPLETE, onscreen=0x565184777160) at ../cogl/cogl/cogl-onscreen.c:175
#12 _cogl_onscreen_notify_complete (onscreen=onscreen@entry=0x565184777160, info=info@entry=0x565185028540) at ../cogl/cogl/cogl-onscreen.c:553
#13 0x00007f37ab72dd3d in meta_onscreen_native_notify_frame_complete (onscreen=0x565184777160) at ../src/backends/native/meta-onscreen-native.c:166
#14 0x00007f37ab732d1b in notify_view_crtc_presented (view=<optimized out>, kms_crtc=<optimized out>, time_us=1930366000, flags=(COGL_FRAME_INFO_FLAG_HW_CLOCK | COGL_FRAME_INFO_FLAG_VSYNC), sequence=115653)
at ../src/backends/native/meta-onscreen-native.c:191
#15 0x00007f37ab72d661 in meta_kms_page_flip_data_flipped (kms=<optimized out>, user_data=0x56518688ed40) at ../src/backends/native/meta-kms-page-flip.c:166
#16 0x00007f37ab747a4e in flush_callbacks.isra.0 (kms=kms@entry=0x5651843139c0) at ../src/backends/native/meta-kms.c:483
#17 0x00007f37ab72d68d in callback_idle (user_data=0x5651843139c0) at ../src/backends/native/meta-kms.c:499
#18 0x00007f37ac324c24 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007f37ac3796f8 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007f37ac324293 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007f37ab694869 in meta_context_run_main_loop (context=<optimized out>, error=0x7fff3cd49eb8) at ../src/core/meta-context.c:437
#22 0x0000565182e5af12 in ()
#23 0x00007f37ab3c5d90 in __libc_start_call_main (main=main@entry=0x565182e5aa70, argc=argc@entry=1, argv=argv@entry=0x7fff3cd4a058) at ../sysdeps/nptl/libc_start_call_main.h:58
#24 0x00007f37ab3c5e40 in __libc_start_main_impl (main=0x565182e5aa70, argc=1, argv=0x7fff3cd4a058, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff3cd4a048)
at ../csu/libc-start.c:392
#25 0x0000565182e5b1b5 in ()
- It seems to me the issue usually happen in 2nd "page allocation fault" from gnome-shell.
Sep 14 10:39:22 ubuntu kernel: gnome-shell: page allocation failure: order:0, mode:0x104cd2(GFP_HIGHUSER|__GFP_RETRY_MAYFAIL|__GFP_RECLAIMABLE), nodemask=(null),cpuset=/,mems_allowed=0
Sep 14 10:39:22 ubuntu kernel: CPU: 7 PID: 1195 Comm: gnome-shell Not tainted 5.17.0-1016-oem #17-Ubuntu
Sep 14 10:39:22 ubuntu kernel: Hardware name: HP HP ProOne 440 23.8 inch G9 All-in-One Desktop PC/8958, BIOS U13 Ver. 02.03.04 06/22/2022
Sep 14 10:39:22 ubuntu kernel: Call Trace:
Sep 14 10:39:22 ubuntu kernel: <TASK>
Sep 14 10:39:22 ubuntu kernel: show_stack+0x52/0x59
Sep 14 10:39:22 ubuntu kernel: dump_stack_lvl+0x4c/0x64
Sep 14 10:39:22 ubuntu kernel: dump_stack+0x10/0x13
Sep 14 10:39:22 ubuntu kernel: warn_alloc+0x135/0x160
Sep 14 10:39:22 ubuntu kernel: __alloc_pages_slowpath.constprop.0+0x88e/0x8d0
Sep 14 10:39:22 ubuntu kernel: __alloc_pages+0x327/0x340
Sep 14 10:39:22 ubuntu kernel: alloc_pages_vma+0x98/0x350
Sep 14 10:39:22 ubuntu kernel: __read_swap_cache_async+0x11a/0x300
Sep 14 10:39:22 ubuntu kernel: swap_cluster_readahead+0x162/0x2f0
Sep 14 10:39:22 ubuntu kernel: shmem_swapin+0x95/0xe0
Sep 14 10:39:22 ubuntu kernel: shmem_swapin_page+0x195/0x360
Sep 14 10:39:22 ubuntu kernel: shmem_getpage_gfp+0x4cf/0x850
Sep 14 10:39:22 ubuntu kernel: shmem_read_mapping_page_gfp+0x49/0x100
Sep 14 10:39:22 ubuntu kernel: shmem_sg_alloc_table+0x169/0x280 [i915]
Sep 14 10:39:22 ubuntu kernel: shmem_get_pages+0xaa/0x2e0 [i915]
...
Sep 14 10:39:23 ubuntu kernel: drm_ioctl_kernel+0xb5/0x150 [drm]
Sep 14 10:39:23 ubuntu kernel: drm_ioctl+0x265/0x4b0 [drm]
Sep 14 10:39:23 ubuntu kernel: ? i915_gem_do_execbuffer+0xfe0/0xfe0 [i915]
Sep 14 10:39:23 ubuntu kernel: ? __fget_light+0xa7/0x130
Sep 14 10:39:23 ubuntu kernel: __x64_sys_ioctl+0x8f/0xd0
Sep 14 10:39:23 ubuntu kernel: do_syscall_64+0x59/0xc0
Sep 14 10:39:23 ubuntu kernel: ? asm_exc_page_fault+0x8/0x30
Sep 14 10:39:23 ubuntu kernel: entry_SYSCALL_64_after_hwframe+0x44/0xae
Sep 14 10:39:23 ubuntu kernel: RIP: 0033:0x7f2b8bef8aff
Sep 14 10:39:23 ubuntu kernel: Code: Unable to access opcode bytes at RIP 0x7f2b8bef8ad5.
Sep 14 10:39:23 ubuntu kernel: RSP: 002b:00007ffd50d06bd0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
Sep 14 10:39:23 ubuntu kernel: RAX: ffffffffffffffda RBX: 00007ffd50d06c80 RCX: 00007f2b8bef8aff
Sep 14 10:39:23 ubuntu kernel: RDX: 00007ffd50d06c80 RSI: 0000000040406469 RDI: 0000000000000013
Sep 14 10:39:23 ubuntu kernel: RBP: 00007ffd50d06d10 R08: 000055fe4b6cd280 R09: 000055fe4b4a8cb0
Sep 14 10:39:23 ubuntu kernel: R10: 0000000000502080 R11: 0000000000000246 R12: 0000000000000013
Sep 14 10:39:23 ubuntu kernel: R13: 000055fe4b8edca0 R14: 000055fe4b6c1348 R15: 000055fe4b6c1348
Sep 14 10:39:23 ubuntu kernel: </TASK>
Sep 14 10:39:23 ubuntu kernel: Mem-Info:
Sep 14 10:39:23 ubuntu kernel: active_anon:133346 inactive_anon:650083 isolated_anon:196
active_file:131 inactive_file:0 isolated_file:0
unevictable:6495 dirty:6 writeback:52
slab_reclaimable:11929 slab_unreclaimable:28956
mapped:3055 shmem:19657 pagetables:6214 bounce:0
kernel_misc_reclaimable:0
free:22233 free_pcp:2 free_cma:0
Edited by Jeremy Su