Bug 410856 - wayland: kwin uses 100% cpu when idle and kscreenlocker activates
Summary: wayland: kwin uses 100% cpu when idle and kscreenlocker activates
Status: RESOLVED WORKSFORME
Alias: None
Product: plasmashell
Classification: Plasma
Component: Screen locking (other bugs)
Version First Reported In: 5.18.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: efficiency-and-performance
Depends on:
Blocks:
 
Reported: 2019-08-12 16:51 UTC by Miroslav Spehar
Modified: 2025-06-18 03:47 UTC (History)
6 users (show)

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


Attachments
htop showing cpu usage (596.57 KB, image/png)
2019-08-12 16:51 UTC, Miroslav Spehar
Details
kubuntu htop showing cpu usage (1010.34 KB, image/png)
2019-08-12 17:35 UTC, Miroslav Spehar
Details
25% cpu kwin (1.13 MB, image/png)
2019-08-13 18:13 UTC, Miroslav Spehar
Details
Screenshot of htop with close to 100% cpu usage (483.72 KB, image/png)
2022-10-11 16:36 UTC, thenujan
Details
Htop showing the command of the kwin_wayland process taking high cpu usage (257.43 KB, image/png)
2022-10-11 16:43 UTC, thenujan
Details
screenlocker with controls (1.62 MB, image/png)
2024-06-14 21:57 UTC, Miroslav Spehar
Details
top showing high cpu usage for screen locker (208.85 KB, image/png)
2024-06-14 21:58 UTC, Miroslav Spehar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miroslav Spehar 2019-08-12 16:51:10 UTC
Created attachment 122090 [details]
htop showing cpu usage

SUMMARY
100% cpu usage when left to be idle in VM. 
when screen is activated, cpu usage drops.


STEPS TO REPRODUCE
1. install basic archlinux desktop with kde plasma
2. login into wayland session
3. disable baloo
4. leave the machine for a while

OBSERVED RESULT
100% cpu usage in kwin

EXPECTED RESULT
minimal cpu usage for kwin


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: latest
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.60
Qt Version: 5.13

ADDITIONAL INFORMATION
journal | grep kwin

Aug 03 18:03:17 vm-arch kernel: kwin_wayland[450]: segfault at 128 ip 00007f645d812e9c sp 00007ffd89473ee0 error 4 in libkwin.so.5.16.4[7f645d66f000+1eb000]
Aug 03 18:03:17 vm-arch kernel: audit: type=1701 audit(1564848197.113:57): auid=1000 uid=1000 gid=998 ses=2 pid=450 comm="kwin_wayland" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 03 18:03:17 vm-arch audit[450]: ANOM_ABEND auid=1000 uid=1000 gid=998 ses=2 pid=450 comm="kwin_wayland" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 03 18:05:32 vm-arch kernel: audit: type=1701 audit(1564848332.356:38): auid=1000 uid=1000 gid=998 ses=2 pid=448 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 03 18:05:32 vm-arch audit[448]: ANOM_ABEND auid=1000 uid=1000 gid=998 ses=2 pid=448 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 11 12:22:16 vm-arch audit[3307]: ANOM_ABEND auid=1000 uid=1000 gid=998 ses=2 pid=3307 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 11 12:22:16 vm-arch kernel: audit: type=1701 audit(1565518936.686:44): auid=1000 uid=1000 gid=998 ses=2 pid=3307 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 11 12:36:50 vm-arch audit[450]: ANOM_ABEND auid=1000 uid=1000 gid=998 ses=2 pid=450 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 11 12:36:50 vm-arch kernel: audit: type=1701 audit(1565519810.083:42): auid=1000 uid=1000 gid=998 ses=2 pid=450 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
                                            Available platform plugins are: wayland-org.kde.kwin.qpa, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Aug 11 12:49:23 vm-arch kdeinit5[750]: kio_smb: dirp->name  kwin.txt   "kwin.txt"  ' "" '   8
Aug 11 12:49:23 vm-arch kdeinit5[750]: kio_smb: updateCache  "/red/kwin.txt"
Aug 11 12:49:24 vm-arch kdeinit5[743]: kio_smb: dirp->name  kwin.txt   "kwin.txt"  ' "" '   8
Aug 11 12:49:24 vm-arch kdeinit5[743]: kio_smb: updateCache  "/red/kwin.txt"
Aug 11 12:51:10 vm-arch systemsettings5[758]: org.kde.kcoreaddons: Error loading plugin "kcm_kwindecoration" "The shared library was not found." 
Aug 11 12:51:10 vm-arch systemsettings5[758]: Module 'org.kde.kwin.decoration' does not contain a module identifier directive - it cannot be protected from external registrations.
Aug 11 12:51:13 vm-arch systemsettings5[758]: KActivitiesStats( 0x55c343144b00 ) ResultModelPrivate::onResultScoreUpdated  result added: "kcm:kwindecoration.desktop" score: 0 last: 1565520673 first: 1565520673
Aug 11 12:55:09 vm-arch audit[451]: ANOM_ABEND auid=1000 uid=1000 gid=998 ses=2 pid=451 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 11 12:55:09 vm-arch kernel: audit: type=1701 audit(1565520909.576:44): auid=1000 uid=1000 gid=998 ses=2 pid=451 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 11 13:27:19 vm-arch audit[450]: ANOM_ABEND auid=1000 uid=1000 gid=998 ses=2 pid=450 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 11 13:27:19 vm-arch kernel: audit: type=1701 audit(1565522839.420:45): auid=1000 uid=1000 gid=998 ses=2 pid=450 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 11 13:28:03 vm-arch audit[453]: ANOM_ABEND auid=1000 uid=1000 gid=998 ses=2 pid=453 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 11 13:28:03 vm-arch kernel: audit: type=1701 audit(1565522883.836:42): auid=1000 uid=1000 gid=998 ses=2 pid=453 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
                                           Available platform plugins are: wayland-org.kde.kwin.qpa, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Aug 11 13:29:02 vm-arch systemsettings5[660]: org.kde.kcoreaddons: Error loading plugin "kcm_kwindecoration" "The shared library was not found." 
Aug 11 13:29:02 vm-arch systemsettings5[660]: Module 'org.kde.kwin.decoration' does not contain a module identifier directive - it cannot be protected from external registrations.
Aug 11 13:29:06 vm-arch systemsettings5[660]: KActivitiesStats( 0x5623a676c970 ) ResultModelPrivate::onResultScoreUpdated  result added: "kcm:kwindecoration.desktop" score: 1 last: 1565522942 first: 1565520673
Aug 12 08:04:23 vm-arch audit[447]: ANOM_ABEND auid=1000 uid=1000 gid=998 ses=2 pid=447 comm="kwin_wayland" exe="/usr/bin/kwin_wayland" sig=6 res=1
Aug 12 08:04:23 vm-arch kernel: audit: type=1701 audit(1565589863.056:124): auid=1000 uid=1000 gid=998 ses=2 pid=447 comm="kwin_wayland" exe="/usr/bin/kwin_wayland" sig=6 res=1
Aug 12 08:04:31 vm-arch systemd-coredump[6705]: Process 447 (kwin_wayland) of user 1000 dumped core.
Aug 12 08:34:51 vm-arch audit[6793]: ANOM_ABEND auid=1000 uid=1000 gid=998 ses=5 pid=6793 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 12 08:34:51 vm-arch kernel: audit: type=1701 audit(1565591691.453:148): auid=1000 uid=1000 gid=998 ses=5 pid=6793 comm="QDBusConnection" exe="/usr/bin/kwin_wayland" sig=11 res=1
Comment 1 Miroslav Spehar 2019-08-12 17:35:33 UTC
Created attachment 122091 [details]
kubuntu htop showing cpu usage

same thing happens on kubuntu with latest updates. i uninstalled plasma-discover and disabled ubuntu.

cpu spike is triggered when kscreen locker kicks in
Comment 2 Miroslav Spehar 2019-08-12 17:37:33 UTC
*disabled baloo
Comment 3 Martin Flöser 2019-08-13 10:31:40 UTC
You are running multiple KWin instances. This is probably the reason for the high cpu usage. Please kill the additional ones.
Comment 4 Miroslav Spehar 2019-08-13 18:13:25 UTC
after reinstallation of virtual machine, same situation again.
post installaton steps:
- update all packages
- remove plasma-discover
- install openssh-server
- apt autoremove
- configure autologin to wayland session in plasma settings


status after reinstall:
- cpu is ~25% while lockscreen is on
- after monitors are turned off, session cannot be recovered via gui


if i kill one of the other processes, session crashes.
fwiw, i do not start manually those kwin processes, they are started by sddm it seems. i added a screenshot of htop with hierarchy.
Comment 5 Miroslav Spehar 2019-08-13 18:13:39 UTC
Created attachment 122102 [details]
25% cpu kwin
Comment 6 thenujan 2022-10-11 16:36:36 UTC
Created attachment 152710 [details]
Screenshot of htop with  close to 100% cpu usage

Same happens in my manjaro machine nearly 100% cpu when logging into wayland
Comment 7 thenujan 2022-10-11 16:43:45 UTC
Created attachment 152711 [details]
Htop showing the command of the  kwin_wayland process taking high cpu usage
Comment 8 Zamundaaa 2024-06-07 17:26:38 UTC
Do you still experience this in Plasma 6?
Comment 9 Miroslav Spehar 2024-06-14 21:56:48 UTC
This exact problem is now manifesting only when lockscreen is shown and while lockscreen is showing controls.
Comment 10 Miroslav Spehar 2024-06-14 21:57:33 UTC
Created attachment 170508 [details]
screenlocker with controls
Comment 11 Miroslav Spehar 2024-06-14 21:58:23 UTC
Created attachment 170509 [details]
top showing high cpu usage for screen locker
Comment 12 Miroslav Spehar 2024-06-14 21:59:28 UTC
this is now using plasma 6.0.5
Comment 13 Bug Janitor Service 2024-06-29 03:47:23 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 14 Miroslav Spehar 2024-06-29 06:05:46 UTC
Answered above
Comment 15 Nate Graham 2025-05-19 19:48:33 UTC
And still with Plasma 6.3.5 or later? Thanks again!
Comment 16 Bug Janitor Service 2025-06-03 03:47:45 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 17 Bug Janitor Service 2025-06-18 03:47:52 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.