Bug 399209 - kwin_wayland has 100% CPU usage during screenlock
Summary: kwin_wayland has 100% CPU usage during screenlock
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (show other bugs)
Version: git master
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-29 11:32 UTC by Fabian Vogt
Modified: 2023-05-11 08:57 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Vogt 2018-09-29 11:32:28 UTC
kwin_wayland has 100% cpu usage when the screen is locked.
It happens only (but 100% of the reproducible) by locking the session. Starting kscreenlocker_greet (with and without --testing) leaves kwin_wayland idle.

Running in a QEMU VM with virtio gpu (no hw acceleration).

Backtrace: 

#0  0x00007f02afb234dc in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f02a17b8b23 in ?? () from /usr/lib64/dri/virtio_gpu_dri.so
#2  0x00007f02a17c3dfd in ?? () from /usr/lib64/dri/virtio_gpu_dri.so
#3  0x00007f02a17c4913 in ?? () from /usr/lib64/dri/virtio_gpu_dri.so
#4  0x00007f02a1184481 in ?? () from /usr/lib64/dri/virtio_gpu_dri.so
#5  0x00007f02adc27294 in KWin::GLVertexBuffer::endOfFrame() () from /usr/lib64/libkwinglutils.so.11
#6  0x00007f02a31d62d0 in KWin::SceneOpenGL::paint(QRegion, QList<KWin::Toplevel*>) () from /usr/lib64/qt5/plugins/org.kde.kwin.scenes/KWinSceneOpenGL.so
#7  0x00007f02b03acb2a in KWin::Compositor::performCompositing() () from /usr/lib64/libkwin.so.5
#8  0x00007f02a3a06e35 in drmHandleEvent () from /usr/lib64/libdrm.so.2
#9  0x00007f02a3a21de9 in ?? () from /usr/lib64/qt5/plugins/org.kde.kwin.waylandbackends/KWinWaylandDrmBackend.so
#10 0x00007f02af1f41a0 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
Comment 1 David Edmundson 2018-10-02 18:03:40 UTC
100% usage but you can still move the mouse about and stuff? or completely locked?


If it is still usable I fear your backtrace is misleading. Output from perf would be better.
Comment 2 Fabian Vogt 2018-10-02 18:23:55 UTC
(In reply to David Edmundson from comment #1)
> 100% usage but you can still move the mouse about and stuff? or completely
> locked?

I can unlock normally.

> If it is still usable I fear your backtrace is misleading. Output from perf
> would be better.

The perf output is equally misleading, mostly llvmpipe.

I assume it gets an infinite stream of DRM events and redraws at the highest possible frame rate or something like that...

It does not happen with kscreenlocker_greet (with or without --testing) and kwin_wayland --lockscreen in windowed mode.
Comment 3 Martin Flöser 2018-10-02 19:18:22 UTC
What about other fullscreen windows?
Comment 4 Fabian Vogt 2018-10-02 19:21:56 UTC
(In reply to Martin Flöser from comment #3)
> What about other fullscreen windows?

I tried konsole in fullscreen mode with wl-shell, CPU usage remained normal.
Maybe there's a better application I could try?

Manually running kscreenlocker_greet doesn't trigger the issue though.
Comment 5 Martin Flöser 2018-10-03 15:16:58 UTC
That could indicate that the problem might be the windows not rendered when the screen is locked.
Comment 6 David Edmundson 2023-05-11 08:57:29 UTC
Given it's reported by Fabian I'm confident he would have poked us directly if this was still an issue.