Bug 422625 - KWin randomly becomes terribly slow
Summary: KWin randomly becomes terribly slow
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.18.90
Platform: Other Linux
: HI normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-08 11:50 UTC by Ilya Bizyaev
Modified: 2020-06-15 16:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Bizyaev 2020-06-08 11:50:11 UTC
SUMMARY
After random periods of time after session start, KWin decides it's a photo frame and starts producing a slideshow :)

It's not a hardware issue (unchanged), not a kernel bug (unchanged), not a Mesa or X server bug (updates reverted), not a lack of resources (CPU, GPU and RAM stats are all fine). Re-login into the session helps but is very annoying. Replacing KWin doesn't help, yet killing and starting it again seems to. Started after an upgrade from 5.18.x to 5.18.90.

STEPS TO REPRODUCE
1. I wish I had them, but seems to happen fairly randomly. I had a feeling it sometimes correlates with window resizing or launching chromium-based software, but I'm unsure. Just using the computer for 5-60 minutes is more reliable.

OBSERVED RESULT
The whole session feels like VNCing over a slow connection

EXPECTED RESULT
Usable session at all times :)

SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.1
KDE Plasma Version: 5.18.90
KDE Frameworks Version: 5.70.0
Qt Version: 5.15.0
Kernel Version: 5.7.0-3.gad96a07-default
OS Type: 64 bits
Processors: 8 × Intel® Core™ i5-10210U CPU @ 1.60GHz
Memory: 15,3 Gb RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 


ADDITIONAL INFORMATION
When the problem occurs, there appears to be a consistent slow paint interval. It seems to not affect window decorations and effects sometimes, and it doesn't affect the mouse cursor, but it always affects window contents. If all windows are closed, Plasma behaves smoothly, too.
Comment 1 Ilya Bizyaev 2020-06-08 12:28:57 UTC
Replacing KWin seems to also help now; didn't help earlier, maybe is somehow related to x11 downgrade.

Anyway, I have found one way to consistently reproduce this on my machine: restore and then maximize Firefox with CSD enabled by dragging its headerbar to the top edge.
Comment 2 Ilya Bizyaev 2020-06-08 12:35:45 UTC
The key seems to be in the maximize animation itself, when kwin animates the future region for the app. Just reproduced with Telegram as well.
Comment 3 Vlad Zahorodnii 2020-06-11 06:15:46 UTC
> affect the mouse cursor, but it always affects window contents.

Urgh, it could be that I broke it.... :/

Do you see some other unusual things, e.g. high CPU usage, etc?
Comment 4 Ilya Bizyaev 2020-06-15 07:21:18 UTC
> Do you see some other unusual things, e.g. high CPU usage, etc?
No, as I mentioned, all observable resources are fine...

But I managed to find the reason: the issue was somehow caused by a popular KWin script called Parachute (https://github.com/tcorreabr/Parachute). Disabling it fixes the problem for me, and re-enabling returns it. I don't know though if it's a bug in the script or in KWin itself.
Comment 5 Nate Graham 2020-06-15 16:07:56 UTC
I'd start with Parachute. IIRC the developers is aware that it's implemented in an inefficient way right now. He might be open to assistance on that front. See https://phabricator.kde.org/T13224
Comment 6 Ilya Bizyaev 2020-06-15 16:11:46 UTC
I suspect there's some KWin bug still involved here since the issue occurs when the effect shouldn't even be triggered and persists for the whole session afterward. But I don't know enough of what KWin scripting API allows to do to be sure.