Bug 485609 - cpu usage at 100% when moving the mouse on wayland but not on X11
Summary: cpu usage at 100% when moving the mouse on wayland but not on X11
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: performance (other bugs)
Version First Reported In: 6.0.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2024-04-15 19:36 UTC by cantfind
Modified: 2025-05-07 18:16 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 cantfind 2024-04-15 19:36:08 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY
When moving the mouse, a single core is being fully utilized by kwin_wayland.
When using Plasma on X11 on the same machine, this does not happen.

STEPS TO REPRODUCE
1.  log in with plasma wayland
2.  run top
3.  move mouse around constantly for more than a second

OBSERVED RESULT
A single core being fully utilized at 100% by kwin_wayland

EXPECTED RESULT
The mouse moving around shouldn't use that much CPU, as it doesn't on X11.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.8.5-1/6.0.3 
(available in About System)
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
Intel GPU (core i7-6500u, HD Graphics 520), Vulkan is reportedly supported.
Comment 1 S. Umar 2024-04-26 20:58:14 UTC
I can confirm this on the new Fedora 40. kwin_wayland both on laptop Intel HD graphics and Workstaion with NVIDIA drivers use 2-3% of CPU when nothing is done. When one moves the mouse it goes up to 15-17%. Fedora 40 no longer provides the X11 option for Plasma 6 so we need a solution for this.
Comment 2 TraceyC 2025-04-15 16:33:02 UTC
Thanks for the bug report. I'm sorry we weren't able to get to this yet. There have been many fixes and improvements since this was opened, and this issue may have been fixed.

Can you please re-test on your system with Plasma 6.3.4 or later and let us know if you can still reproduce the problem? Thanks!
Comment 3 S. Umar 2025-04-17 11:47:53 UTC
This seems to be fixed in the latest...I don't even see kwin in "top".
Comment 4 TraceyC 2025-04-17 16:15:03 UTC
(In reply to S. Umar from comment #3)
> This seems to be fixed in the latest...I don't even see kwin in "top".

That's great news.

cantfind@gmail.com, are you still seeing this problem on an up to date system?
Comment 5 Bug Janitor Service 2025-05-02 03:47:27 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 6 cantfind 2025-05-03 12:04:04 UTC
Ok, I have rechecked using live Neon stable:
Palsma 6.3.4
KDE Frameworkd 6.13.0
Qt 6.8.3
Kernel 6.11.0-24

There's some improvement when the mouse is moved over KDE applications (e.g. Dolphin, Konsole, Okular, the desktop) - kwin_wayland uses ~30% a core for that now instead of 100%. But if the mouse if moved over Firefox (blank area in the default Firefox homepage) - kwin_wayland uses 100% of a core, and firefox-bin uses ~50% of a core. Gimp and bitwarden use xwayland for some reason, and there kwin_wayland was similar to KDE applications.

Moving to X11, CPU usage was still lower across the board. kwin_x11 uses about a quarter of what kwin_wayland uses on KDE applications, firefox_bin still uses the same amount of CPU, but kwin_x11 doesn't use lots of CPU as opposed to kwin_wayland in this scenario either. 

In short - it got better for most applications I have tested - but X11 was still noticeably more efficient in CPU usage.
Comment 7 TraceyC 2025-05-07 18:16:31 UTC
Thanks for the update.

I'm not able to reproduce the original bug (one CPU is at 100% moving the mouse, particularly over a new default tab in Firefox) on:
git-master, Wayland - system with an NVIDIA GPU and 16 CPU cores
OpenSuse Tumbleweed VM with 4 CPU cores

I *am* able to reproduce this on:
Fedora 42 VM with 4 CPU cores. Note that by default, Fedora has customized Firefox to load fedorraproject.org/start on new tabs. This page does cause CPU usage spikes from kwin_wayland on git-master as well.

Neon Testing VM with 4 CPU cores with the default new tab content