xwayland: ProcCreatePixmap becoming very slow after many repeated calls on kernel 6.10
An investigation on the Arch Linux forums into a dramatic slowdown of certain applications following upgrading the kernel 6.10 uncovered an issue where xwayland begins to take a large amount of CPU time after a while (maxing out a single thread at 100% cpu when pinned to a single core). The issue was resolved by downgrading the kernel to 6.9, and reappeared when reupgraded, so a bisect was performed. Bisecting the kernel resulted in this commit, which seems to wire up AMDGPU with the DRM buddy allocator.
Profiling XWayland via perf
/ Hotspot found that a call stack from ProcCreatePixmap following into kernel code in AMDGPU (I have an AMD GPU) ending at list_insert_sorted
is taking a very long time to execute.
See the thread on the Arch Linux forums (also linked above) for prior discussion and more background information on the matter: https://bbs.archlinux.org/viewtopic.php?pid=2188331.
Summary of prior discussion:
- Seems to only occur in XWayland, not native xorg server
- Most affected applications we've found are: GIMP, Prusa Slicer
- GTK applications seem more(only?) affected
- Needs to run in XWayland to display symptoms, use
GDK_BACKEND=x11
env var.
- Needs to run in XWayland to display symptoms, use
- We have AMD GPUs
- Downgrading to linux 6.9 is a temporary fix