Bug 460348

Summary: Plasmashell high CPU usage
Product: [Unmaintained] ksysguard Reporter: Urs Schroffenegger <nab+kde>
Component: libksysguardAssignee: KSysGuard Developers <ksysguard-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: ahiemstra, bugseforuns, nate, nicolas.fella, notmart, plasma-bugs
Priority: NOR Keywords: regression
Version: 5.26.0   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Urs Schroffenegger 2022-10-13 10:07:45 UTC
SUMMARY
I updated my Debian Sid to kde 5.26 yesterday. After restarting today, I noticed that the UI is getting sluggish from time to time or even hangs for a while. In htop, it looks like plasmashell is always lingering at 25-30% of CPU.

The machine is Debian Sid, on X11, with a nvidia 2080 ti, and latest 510.0 nvidia drivers from the debian sid repo.


STEPS TO REPRODUCE
1. upgrade debian sid to kde 5.26
2. restart
3. log in to kde X11
4. run htop


OBSERVED RESULT
plasmashell takes up 35-30% of cpu, UI is sluggish and hangs

EXPECTED RESULT
pasmashell is somewhere down in the noise in CPU usage and spikes a bit up when more UI intense stuff happens.

SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 5.19.0-2-amd64 (64-bit)
Graphics Platform: X11
Processors: 48 ร— AMD Ryzen Threadripper 3960X 24-Core Processor
Memory: 31.2 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2
Manufacturer: ASUS


ADDITIONAL INFORMATION

Having stumbled upon bug #460248, I checked the output of 
$ sudo perf top -K -p $(pidof plasmashell)

Samples: 10K of event 'cycles', 4000 Hz, Event count (approx.): 2988952206 lost: 0/0 drop: 0/0
Overhead  Shared Object                  Symbol
  15.59%  libKSysGuardSensors.so.5.26.0  [.] KSysGuard::SensorDataModel::data
   5.20%  libQt5Core.so.5.15.6           [.] operator<
   4.78%  libQt5Core.so.5.15.6           [.] QVariant::QVariant
   3.49%  libQt5Core.so.5.15.6           [.] QVariant::toString
   2.87%  libQt5Core.so.5.15.6           [.] operator==
   2.53%  libQt5Core.so.5.15.6           [.] 0x000000000014af6d
   2.43%  libKSysGuardSensors.so.5.26.0  [.] 0x0000000000014910
   1.75%  libKSysGuardSensors.so.5.26.0  [.] 0x00000000000148c6
   1.70%  libKSysGuardSensors.so.5.26.0  [.] KSysGuard::SensorDataModel::rowCount
   1.68%  libQt5Core.so.5.15.6           [.] QVariant::~QVariant
   1.54%  libQt5Core.so.5.15.6           [.] QVariant::toDouble
   1.43%  libQt5Core.so.5.15.6           [.] 0x000000000014af30

I'm not familiar with perf, but it looks like the ksysguard sensor reading is taking time?
I have three sensors active in my top bar:
- Individual core usage
- Total CPU usage
- Memory usage

If I get rid of these, the behaviour is the same. But if I reboot after removing them, plasmashell cpu usage is normal.
Adding one of those sensor widgets again bumps plasmashell cpu usage up again.
Comment 1 Patrick Silva 2022-10-13 12:01:33 UTC
I had the same problem on Arch Linux after update to Plasma 5.26, but on Wayland. kwin_wayland process was also causing high cpu usage. Deleting kwinrc file in /home/myuser/.config/, logging out and logging in solved my case.
Comment 2 Urs Schroffenegger 2022-10-17 15:32:55 UTC
(In reply to Patrick Silva from comment #1)
> I had the same problem on Arch Linux after update to Plasma 5.26, but on
> Wayland. kwin_wayland process was also causing high cpu usage. Deleting
> kwinrc file in /home/myuser/.config/, logging out and logging in solved my
> case.

I did try and remove kwinrc and restart, it didn't solve the issue here, so I don't think it's the same issue.

Thanks for your answer!
Comment 3 Nicolas Fella 2022-10-17 16:48:02 UTC
(In reply to Patrick Silva from comment #1)
> I had the same problem on Arch Linux after update to Plasma 5.26, but on
> Wayland. kwin_wayland process was also causing high cpu usage. Deleting
> kwinrc file in /home/myuser/.config/, logging out and logging in solved my
> case.

That sounds like https://bugs.kde.org/show_bug.cgi?id=460248
Comment 4 Nate Graham 2024-06-26 23:50:30 UTC
Is this still happening in Plasma 6.1?
Comment 5 Urs Schroffenegger 2024-07-03 07:53:39 UTC
(In reply to Nate Graham from comment #4)
> Is this still happening in Plasma 6.1?

I'm still on kde 5.27.11, debian unstable hasn't updated to 6.x yet, I'll try it then.

I worked around this by not using any sensors. I set up some sensors again and ran into it again, with Plasma Wayland, this time, and NVidia 555.42.

I'll check again once Plasma 6.x is packaged for Debian Sid.
Comment 6 Bug Janitor Service 2024-07-18 03:46:29 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 7 Bug Janitor Service 2024-08-02 03:46:39 UTC
๐Ÿ›๐Ÿงน This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.