Bug 456304 - kwin_wayland takes up 100% CPU after switching to another user
Summary: kwin_wayland takes up 100% CPU after switching to another user
Status: RESOLVED DUPLICATE of bug 452726
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (other bugs)
Version First Reported In: 5.25.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-04 06:54 UTC by hexchain
Modified: 2022-09-03 15:06 UTC (History)
2 users (show)

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


Attachments
perf record -g -p PID / perf report --stdio (115.53 KB, text/plain)
2022-07-04 06:54 UTC, hexchain
Details
perf record -g -p PID / perf report --stdio (with more debug info) (220.49 KB, text/plain)
2022-07-04 14:03 UTC, hexchain
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hexchain 2022-07-04 06:54:53 UTC
Created attachment 150379 [details]
perf record -g -p PID / perf report --stdio

SUMMARY
The kwin_wayland process takes 100% CPU (1 core) after switching to another user.

I've attached a perf report of the kwin_wayland process.

STEPS TO REPRODUCE
1. Start a Plasma (Wayland) session
2. Select "Switch User" in the kickoff menu, and switch to another user

OBSERVED RESULT
Most of the time, the kwin_wayland process of the previous session uses 100% CPU.

EXPECTED RESULT
The kwin_wayland process of the inactive session should not use any significant amount of CPU time.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.25.2
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5
Kernel Version: 5.18.8-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 4800H with Radeon Graphics
Memory: 28.8 GiB of RAM
Graphics Processor: AMD RENOIR
Comment 1 hexchain 2022-07-04 14:03:52 UTC
Created attachment 150389 [details]
perf record -g -p PID / perf report --stdio (with more debug info)
Comment 2 David Edmundson 2022-07-04 22:32:01 UTC
Does it also happen just going to an empty TTY.

The perf trace doesn't show anything special other than timers firing and us idling, but we're probably doing that constantly with zero interval timers.

Can you shove a debug in:

```
    QObject::connect(&compositeTimer, &QTimer::timeout, q, [this]() {
        dispatch();
    });

```

in renderloop.cpp and confirm if that's going crazy
Comment 3 hexchain 2022-07-05 17:35:02 UTC
(In reply to David Edmundson from comment #2)
> Does it also happen just going to an empty TTY.
> 

Yes, it does.

> The perf trace doesn't show anything special other than timers firing and us
> idling, but we're probably doing that constantly with zero interval timers.
> 
> Can you shove a debug in:
> 
> ```
>     QObject::connect(&compositeTimer, &QTimer::timeout, q, [this]() {
>         dispatch();
>     });
> 
> ```
> 
> in renderloop.cpp and confirm if that's going crazy

It doesn't seem to be this timer. I've put a qCWarning there every 100 times the timer gets fired, and when kwin_wayland was inactive and used 100% CPU, it wasn't producing any logs.
Comment 4 c56w1t63 2022-09-03 15:06:08 UTC

*** This bug has been marked as a duplicate of bug 452726 ***