Bug 381280 - Increased CPU usage with Qt 5.9
Summary: Increased CPU usage with Qt 5.9
Status: RESOLVED DUPLICATE of bug 378010
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
: 381394 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-16 14:05 UTC by Jan Kundrát
Modified: 2017-09-22 16:40 UTC (History)
15 users (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 Jan Kundrát 2017-06-16 14:05:33 UTC
I'm seeing increased CPU usage from both kwin_x11 and plasmashell after I updated "everything" after several months of no updates. Now both kwin_x11 and plasmashell consume >20% of CPU time according to htop, and the cooling fan spin on an idle system.

I'm on Gentoo Linux with kernel 4.9.31, xorg-server-1.19.3, xorg-x11-7.4-r2, mesa 17.1.1, Qt 5.9 from git (last week's), kf5 and plasma-* from git master as of last week. I'm using KMS with an integrated Intel Skylake GPU (i5-6300U, Thinkpad T460s).

Initially everything works well. After I dock the machine and kscreen switches to an external screen (which happens to be bigger in resolution), both plasmashell and kwin_x11 put increased load on the CPUs. Stuff gets fixed when I log out and log back in while docked. When I un-dock and re-dock after that (and the screen switches), the increased CPU load is back there.

I tried looking into `perf top` for both kwin_x11 and plasmashell, but I don't see anything that is suspicious to my untrained eyes.

I've heard some rumors on IRC about Qt sending expose events that it should not be sending. I have no clue whether the bug is in Plasma, Qt, Mesa or somewehere else. I know that it is not in the kernel because I see the same behavior on 4.9.18 that I used to run before. However, because I'm seeing this high load in plasma apps, I'm reporting the bug here.
Comment 1 Lukas 2017-06-19 08:03:42 UTC
I am experiencing similar issues with kwin_x11 and plasmashell. Both processes constantly eat up about 20% of CPU time. kwin_x11 CPU usage returns back to normal once I kill plasmashell. The issue arises during regular operation without secondary monitor although I have not testet it with a dock. An strace of plasmashell showed that it was pretty busy with various DRM systemcalls to the i915 Intel graphics driver although I have no idea whether this is in any way related to the issue.

The issue first occurred after a system upgrade which comprised the following changes:
Qt 5.8 -> Qt 5.9
kwin 5.10.1 -> 5.10.2
plasma-workspace 5.10.1 -> 5.10.2

I am running an Arch Linux installation on a Thinkpad T470:
Intel Core i5-7200u
Intel HD Graphics 620

A colleague with a Thinkpad X1 (also Intel CPU and Graphics) experiences the same issue. Please let me know if I can provide you with further information.
Comment 2 Jan Kundrát 2017-06-19 08:17:57 UTC
(In reply to Jan Kundrát from comment #0)
> Initially everything works well. After I dock the machine and kscreen
> switches to an external screen (which happens to be bigger in resolution),
> both plasmashell and kwin_x11 put increased load on the CPUs.

I have one external screen at work (Dell U2711, 2560x1440) and another one (Dell U3014, 2560x1600) at home. This only happens on the work one; I can switch freely at home and there's no issue there. This is on the exact same laptop with the same model of the dock.

An interesting point about my home screen is that kscreen is configured to switch to it automatically, but it actually doesn't make that switch when I dock. I have to either run `xrandr` with no options, or to power-cycle that external screen. After doing any of these two options, kscreen switches the output as expected. I'm not sure if it's related in any way. Either way, plasmashell's and kwin_x11's CPU consumption is always fine with this not-auto-switching screen.

Also confirming because there's more people hitting this than just me.
Comment 3 Robby Engelmann 2017-06-19 15:41:28 UTC
*** Bug 381394 has been marked as a duplicate of this bug. ***
Comment 4 Robby Engelmann 2017-06-19 15:42:40 UTC
I assume my bug is the same as this one, so please find some more information here: https://bugs.kde.org/show_bug.cgi?id=381394
Comment 5 Kevin Ottens 2017-06-23 14:53:07 UTC
I'm seeing this as well, do you happen to use SlideShow for the desktop background? Because I do and I bumped into:
https://bugs.kde.org/show_bug.cgi?id=381000

Trying to see if they're duplicates.
Comment 6 Jan Kundrát 2017-06-23 16:45:24 UTC
> I'm seeing this as well, do you happen to use SlideShow for the desktop
> background?

Nope, my background is a static image.

On the other hand, right now I'm not getting that high CPU usage at this moment. I haven't made any changes to plasma config files; I'm using the same set of applets, the same everything. So it seems that the reproducibility is a bit random :(.
Comment 7 Robby Engelmann 2017-06-23 18:14:54 UTC
The most reproducible way to trigger it is for me:
1. install https://github.com/kotelnik/plasma-applet-weather-widget
2. add it to the panel
3. switch to another activity

This way I get a constantly cpu of plasmashell >15-20% in almost every case.
Comment 8 bj.cardon 2017-07-26 01:35:55 UTC
I'm having an issue that seems like it could be related to this. Whenever I connect to an external screen with a Thunderbolt 3 port, the CPU usage of plasmashell gradually climbs and climbs until htop shows it at ~130%, Xorg climbs to ~60%, and another plasmashell process at ~60%. The machine slows to a crawl.
Comment 9 David Edmundson 2017-07-30 22:58:06 UTC
Jan, can you apply my debug patch on https://bugsfiles.kde.org/attachment.cgi?id=106799 and tell me if you see 

"DAVE: We are the last dirty window, syncing" in the output or not. It should be there every frame, and a max of 60 times a second
Comment 10 Kurt Seebauer 2017-07-31 16:10:21 UTC
I'm having the same isssues and more importantly my computer runs out of memory and freezes after ~24 hours (32 Gig plus swap). I use a few activities in parallel all with their own applets. 
Removing the weather (and other) applets from the screens helped immediately, plasmashell is back from 20% cpu to almost 0.
Comment 11 Alex Ioannou 2017-08-02 08:41:01 UTC
Same thing experienced here on KDE Neon.

PID  USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND    
1346 aioannou  20   0 4191172 214716  89412 S  34.4  2.6 347:18.00 plasmashell                                                                                                                                                                                               
970  root      20   0  388696  93744  42068 S  27.5  1.1 365:32.96 Xorg                                                                                                                                                                                                      
1342 aioannou  20   0 3284368 110304  64048 S  27.5  1.4 426:34.52 kwin_x11

My system is barely usable at the moment with most of the CPU being consumed by these processes.
Comment 12 David Edmundson 2017-08-04 09:29:14 UTC

*** This bug has been marked as a duplicate of bug 378010 ***
Comment 13 andre.cbarros 2017-08-11 23:35:56 UTC
I have this annoying high CPU usage on all machines I upgraded to latest KDE. As like other have reported, even with no fancy things enabled plasmashell expand to consume whatever it can reach and then I kill and restart it to bring it back to an acceptable state. I love KDE and have been a user of it since 199x, survived many incarnations of it but this bug in particular is really, really almost unbearable. What must I do to help provide an usable report?
Comment 14 Martin Kostolný 2017-09-05 21:35:39 UTC
Hi! I know this is resolved dupl. to another bug but I can see some mentions about weather-widget only here. And that it's possibly causing these high CPU problems - I was redirected here from github page of that widget.

I was unfortunately unable to replicate this behaviour on my Arch linux with plasma-applet-weather-widget git version. I have Plasma 5.10.5, KF 5.37, Qt 5.9.1, Xorg, Intel graphics with generic modesetting driver.

Is this still an issue? Is it specific for weather-widget for anybody? If it is the case, please let's talk here: https://github.com/kotelnik/plasma-applet-weather-widget/issues/54
Comment 15 Robby Engelmann 2017-09-17 18:21:45 UTC
Could you please try to add a folderview widget to each of the activities and set them up to show files linked to the current activity.
Then test again the acitivity switching.
I tried to add widget per widget as a new user and after adding these I could reproduce the bug even without the weather-widget under plasma 5.10.95 with frameworks 5.38.
Comment 16 revan 2017-09-22 06:30:14 UTC
I really don't think this bug is a duplicate of 378010 so I'm going to report here. I have a fresh install of KDE Neon on an a dell Latitude 7480 (i7-7600U, HD 620 graphics) with all updates (qt 5.9.1, plasma 5.10.5). I'm using the Dell DA200 USB-C adapter and the laptop's HDMI port to drive 2 dell monitors. 

If I freshly boot my laptop, close the lid (which deactivates the laptop's internal display leaving only the external monitors) lock the screen, leave it for 12 hours when I get check top kwin_x11 eats 8 to 12 percent of my CPU constantly without doing anything (no windows open, static background).

If I freshly boot my laptop, close the lid and look at top kwin_x11 eats 0.4 percent of my CPU constantly. Clearly there is a problem over time.

For now kwin_11 --replace seems to solve the problem, at least temporarily (haven't had the time to leave it over night).

If you need more details contact me. Right now I can reproduce all the steps need for this bug from a fresh KDE Neon install, update, connect monitors, close lid, and voila.
Comment 17 Christoph Feck 2017-09-22 09:14:42 UTC
This ticket (as well as bug 378010) is for the plasmashell process. If you get constant high CPU usage in kwin, and there is no constant painting (check the Show Paint effect) from plasmashell, please report this issue to kwin developers.
Comment 18 Alex Ioannou 2017-09-22 12:17:23 UTC
@Christoph When mine spikes kwin does too.   Does this mean that if I switch to Wayland then the problem might go away?
Comment 19 Christoph Feck 2017-09-22 12:27:41 UTC
If there is no constant repainting, but kwin still uses idle CPU, it is a bug that must be reported, even for the X11 version. It is most likely a driver bug, though.