Plasmashell high CPU bug #356479

Forum rules
Before you post please read how to get help
Post Reply
papanyanz
Level 1
Level 1
Posts: 13
Joined: Fri Nov 25, 2016 6:05 pm

Plasmashell high CPU bug #356479

Post by papanyanz » Sun Jan 01, 2017 3:16 pm

Hello, I'm running linuxmint 18 kde edition and turns out there's a very annoying plasmashell bug #356479, that causes very high CPU every time there's animated icon in your taskbar. In my case it's wireless signal level changing, cpufreq applet, also progress animation when copying large files!
I've googled it and it seems to be fixed already https://bugs.kde.org/show_bug.cgi?id=356479, but I didn't get any update so far, when it's expected to arrive, if at all?

User avatar
acheronuk
Level 2
Level 2
Posts: 59
Joined: Wed Nov 16, 2016 3:21 pm
Location: UK
Contact:

Re: Plasmashell high CPU bug #356479

Post by acheronuk » Sun Jan 01, 2017 5:01 pm

The fix for this is scheduled to be released by KDE in Plasma 5.8.6 on Feb 21st.

However, if this applies cleanly and tests ok with Plasma 5.8.5, will look at backporting to Plasma 5.8.5 update which is currently being tested in kubuntu.
Kubuntu Developer

papanyanz
Level 1
Level 1
Posts: 13
Joined: Fri Nov 25, 2016 6:05 pm

Re: Plasmashell high CPU bug #356479

Post by papanyanz » Sun Jan 01, 2017 5:32 pm

Who will look at the possibility of backporting, is it You who is at the charge of doing that ? Or did you mean it'll be fixed in kubuntu first, and then we will see? Really, want to know. This bug is really bad for my hot notebook.

User avatar
acheronuk
Level 2
Level 2
Posts: 59
Joined: Wed Nov 16, 2016 3:21 pm
Location: UK
Contact:

Re: Plasmashell high CPU bug #356479

Post by acheronuk » Sun Jan 01, 2017 5:46 pm

papanyanz wrote:Who will look at the possibility of backporting, is it You who is at the charge of doing that ? Or did you mean it'll be fixed in kubuntu first, and then we will see? Really, want to know. This bug is really bad for my hot notebook.
Mint 18 uses the kubuntu backports repository to supply it's KDE packages. So the fix will hopefully be uploaded to the kubuntu development version, and then backported and tested for inclusion in the aforementioned backports repository.

Oh, and yes, it is the kubuntu team who are responsible for this, of which I am a part.
Kubuntu Developer

papanyanz
Level 1
Level 1
Posts: 13
Joined: Fri Nov 25, 2016 6:05 pm

Re: Plasmashell high CPU bug #356479

Post by papanyanz » Sun Jan 01, 2017 5:59 pm

Thanks, it sounds to me will appear not so soon anyway, we'll see.

User avatar
acheronuk
Level 2
Level 2
Posts: 59
Joined: Wed Nov 16, 2016 3:21 pm
Location: UK
Contact:

Re: Plasmashell high CPU bug #356479

Post by acheronuk » Sun Jan 01, 2017 9:21 pm

If you would like to help test, there is a 5.8.4 version with the patch in this ppa.

Testing a unreleased patched package is at you own risk of course, but this is supposed to be a stable upstream patch.
Kubuntu Developer

papanyanz
Level 1
Level 1
Posts: 13
Joined: Fri Nov 25, 2016 6:05 pm

Re: Plasmashell high CPU bug #356479

Post by papanyanz » Tue Jan 03, 2017 3:19 pm

Hmm, I would like to try it out perhaps, but ONLY if it doesn't break package dependencies (I'm quite sure it'll be stable itself), is this possible ? I'm not familiar with these advanced package manager things, what should I do "step by step" if I decide to?
plasmashell not only has this nasty bug, but I can see it also sloowly leaks memory - after few days of usage it's risen to 208MB from some 80's in the beginnig.

papanyanz
Level 1
Level 1
Posts: 13
Joined: Fri Nov 25, 2016 6:05 pm

Re: Plasmashell high CPU bug #356479

Post by papanyanz » Wed Jan 04, 2017 4:16 pm

acheronuk wrote:If you would like to help test, there is a 5.8.4 version with the patch in this ppa.

Testing a unreleased patched package is at you own risk of course, but this is supposed to be a stable upstream patch.
Today I got some updates, which among other things installed plasma 5.8.5 version! Do you have any information if this patch was included there or not?
Thanks.

User avatar
acheronuk
Level 2
Level 2
Posts: 59
Joined: Wed Nov 16, 2016 3:21 pm
Location: UK
Contact:

Re: Plasmashell high CPU bug #356479

Post by acheronuk » Wed Jan 04, 2017 4:24 pm

papanyanz wrote:
acheronuk wrote:If you would like to help test, there is a 5.8.4 version with the patch in this ppa.

Testing a unreleased patched package is at you own risk of course, but this is supposed to be a stable upstream patch.
Today I got some updates, which among other things installed plasma 5.8.5 version! Do you have any information if this patch was included there or not?
Thanks.
It is. Backported.
Kubuntu Developer

papanyanz
Level 1
Level 1
Posts: 13
Joined: Fri Nov 25, 2016 6:05 pm

Re: Plasmashell high CPU bug #356479

Post by papanyanz » Wed Jan 04, 2017 6:08 pm

acheronuk wrote:
papanyanz wrote:
acheronuk wrote:If you would like to help test, there is a 5.8.4 version with the patch in this ppa.

Testing a unreleased patched package is at you own risk of course, but this is supposed to be a stable upstream patch.
Today I got some updates, which among other things installed plasma 5.8.5 version! Do you have any information if this patch was included there or not?
Thanks.
It is. Backported.
Many thanks to you personally, amazing how fast it has happened !!!

User avatar
acheronuk
Level 2
Level 2
Posts: 59
Joined: Wed Nov 16, 2016 3:21 pm
Location: UK
Contact:

Re: Plasmashell high CPU bug #356479

Post by acheronuk » Wed Jan 04, 2017 9:00 pm

:)

Well, 5.8.5 was already being prepared, so as said an additional upstream stable bugfix patch is relatively straight forward.
Kubuntu Developer

papanyanz
Level 1
Level 1
Posts: 13
Joined: Fri Nov 25, 2016 6:05 pm

Re: Plasmashell high CPU bug #356479

Post by papanyanz » Sun Jan 08, 2017 8:09 am

After few days of inspection of how my system works after update I have to sadly document that previous behavior didn't change or did it just only marginally, that every time an icon blinks in taskbar - CPU raises to some 50-80% usage,
Even that patch didn't help :( .
Is this because this version of kde/plasma is just too fresh and there was not enough time to optimize everything ? Or maybe performance is less a priority now than the speed of development ? Don't take this as an ingratitude on my side, kde always was the best system for work, but currently there seems no any good desktop for linux!

User avatar
acheronuk
Level 2
Level 2
Posts: 59
Joined: Wed Nov 16, 2016 3:21 pm
Location: UK
Contact:

Re: Plasmashell high CPU bug #356479

Post by acheronuk » Sun Jan 08, 2017 8:19 am

papanyanz wrote:After few days of inspection of how my system works after update I have to sadly document that previous behavior didn't change or did it just only marginally, that every time an icon blinks in taskbar - CPU raises to some 50-80% usage,
Even that patch didn't help :( .
Is this because this version of kde/plasma is just too fresh and there was not enough time to optimize everything ? Or maybe performance is less a priority now than the speed of development ? Don't take this as an ingratitude on my side, kde always was the best system for work, but currently there seems no any good desktop for linux!
That is disappointing.

Unfortunately I was unable to get the issue you are having replicated on any of my installs or that of testers, so it was hard to assess the effectiveness of the fix. Had to focus mostly on testing to see if the patch produced any regressions.

Plasma 5.8 LTS is intended for stability and reliability, but as with any software, sometimes there are corner cases with certain hardware and user configuration that throw up issues that coders were unable to spot.
Kubuntu Developer

Brain
Level 1
Level 1
Posts: 16
Joined: Tue Mar 28, 2017 4:10 pm
Location: U.S.
Contact:

Re: Plasmashell high CPU bug #356479

Post by Brain » Thu Mar 30, 2017 7:58 pm

Any news on this issue?

After installing some firmware updates (GPU), Mint's Linux, Serena 18.1, is now unusable.

Plasmashell has the "needle pinned" with 80% 100% CPU usage. My CPU temperatures are high, the fans are blowing like a micro tornado, and the desktop reacts as slowly as that one three-toed sloth they have in Costa Rica (i.e. so slow movement is imperceptible). Kactifvitymanager isn't far behind. Who needs a "stinkin'" kactivitymanager, anyways? I've got enough meddlesome sources trying to manage my activity.

Oh, wait. Plasmasell isn't even registering CPU usage now. THAT (whatever it was that plasmashell was doing/trying) only took 20 minutes on a 7700K CPU running at 4.5Ghz. I think I'm going to get a debug version of plasmashell & slap a debugger on it and see what it says.

Also, the PPA mentioned in the thread no longer exists.

UPDATE TO THIS POST

Since I posted this status-inquiry on updated plasmashell, I have new information:
1) Plasmashell will inexplicably, seemingly randomly use 100% of system resources for a few minutes and then go back to 0% to 5%. I could just be reading a document on the screen and plasmashell & its accomplice, kactivitymanager, will go at the CPU hard, & then stop. I can only assume some automated system activity has fired off in the background, although I can't see what it is. I have ksysguard running constantly on another monitor watching system activity and I'll just see those two processes hitting the processor with processing requests.
2) I'm copying a file. That's it. little old background process "copy these bits from that source to this destination." So file.so goes & does it's thing, consuming something like 10% of the CPU (which also seems high when you consider the trivial computational nature of file transfer 10% of a 7th generation Intel CPU running at 4.5Ghz doesn't make a file transfer happen any faster than the ARM device in my smartphone, the CPU isn't the limiting factor, it's the other stuff, like the slowness of the media that bogs these things down, the CPU should be loafing around mostly), meanwhile Plasmashell is consuming it's own share of > 30% CPU resources. Call me stupid, but what part of a file transfer requires 30% of the shell's resources? I can copy files in a terminal and use no graphical shell resources. Isn't that simply what's happening in the background anyways? A "cp" command?

Total system resources when you add in xorg, kwin_x11, kuiserver5, dolphin, dbus, kworker, cifsd are between 65% & 75% of CPU. For a file transfer. All that to move some bits and to paint an updated screen that has as it's only activity a progress indicator occupying a few dozen x a few dozen pixels.

I like KDE. It's definitely been my desktop of choice for years now (and I've tried them all), but this plasmashell issue is annoying. I guess I could just bug the KDE guys, they've already got a plasmashell 5.9 that supposedly fixes this, but it's not in repositories I have access to and I can't find a PPA.

UPDATE 4/2/17

There is absolutely nothing going on. I was working on a couple of things, but have paused them. Plasmashell is at 140% CPU with Xorg at 65% CPU. I don't know what it thinks is processing. All file activity is stopped, there's a couple of applications waiting for input, but not doing anything (a few % points each). The CPU Mhz is maxed out at 4.6Ghz SOLID. CPU temps are in the 70'C range. I greped plasmashells lsof & what I see is a bunch of gnu plugins & some file delete DRMs in progress. I wonder if it's LVM somehow. LVM daemon runs, but I don't even use LVM. I just figured it was a "Mint Thing" to automatically run LVM for some meta-data reason. I can't reboot because I have so much stuff in progress. I could kill the shell, but I'm afraid of losing my place in as many applications as I have running. I'm using a 7700K clocked at 4.6Ghz, 32MB memory, M.2 SATAIII & SATAII storage. What amounts to "enough" hardware to run this OS? My desktop experience is acceptable, not "amazing." I can do a couple of things at once. Big deal. 4 hyper-threaded cores with a 7th generation CPU running at clock speeds we only hoped to achieve a few years ago isn't enough?
Mint 18.1; 7700K w/32GB mem., Asus Z270 MB, 128GB M.2 & 37TB SATA HDD, 4K & 2K mon, MX Revolution, Macbook Pro; 5 Laptops; 4 Tablets; Cisco routers & switch; Juniper SRX; 2 NAS; media server; 2 UPS w/diverse feeds; KRK near-field mon.

braingateway
Level 3
Level 3
Posts: 105
Joined: Thu Sep 29, 2011 4:21 pm

Re: Plasmashell high CPU bug #356479

Post by braingateway » Mon Apr 10, 2017 11:29 pm

Simple answer:
KDE5 has been released when it is still in alpha-test state :p
Simple solution:
Avoid KDE5

longer version:
2) I'm copying a file. That's it.
Did you try to turn off the animation at all? I never use desktop effect at all, doubt many people use it either.
This may be a GL related problem:
https://bugs.kde.org/show_bug.cgi?id=370003
Thus you can also try to disable openGL for desktop effect, or disable the Vsync of openGL.

Brain
Level 1
Level 1
Posts: 16
Joined: Tue Mar 28, 2017 4:10 pm
Location: U.S.
Contact:

Re: Plasmashell high CPU bug #356479

Post by Brain » Wed Apr 12, 2017 4:05 am

braingateway wrote:Simple answer:
KDE5 has been released when it is still in alpha-test state :p
Simple solution:
Avoid KDE5

longer version:
2) I'm copying a file. That's it.
Did you try to turn off the animation at all? I never use desktop effect at all, doubt many people use it either.
This may be a GL related problem:
https://bugs.kde.org/show_bug.cgi?id=370003
Thus you can also try to disable openGL for desktop effect, or disable the Vsync of openGL.
Thank you for the suggestion on Vsync + openGL. I'll investigate that. I try not to use desktop effects, I try to turn them all off, but they pop-in automagically from time-to-time despite my efforts for reasons I've yet to discover, or resolve.

Regarding "not using KDE". Your comment made me smile. I might try some of the other steering wheels. None of them have tempted me enough. I

I think in the interim of writing my last post & now I've figured out what the problem with Plasmashell is: for reasons I've yet to figure out, there is some process that is trying to do something with meta-data, mime information, or something else file related. When Plasmashell goes crazy, I've looked at the processes spawned & what they're trying to do, & what they're trying to do is some sort of file access, validate some sort of mime data, update some meta-data, or something along those lines. The process tries to open files it can't because they're on drives that aren't mounted. These drives were previously unmounted cleanly. (Before I unmount a drive, I let it settle down for whatever random process thinks it still needs to do some kind of majgic that only its capable of, like LVM, or just to let the journals be updated. I let them settle for more than the 5-second ext4 journal-flush window, usually about 30 seconds, then unmount. I never get a warning from anything.) Despite my efforts to always keep a clean file-system, this un-named process at some later point tries to do file I/O, launched from kactivitymanager will come on, sometimes after a clean boot, from a clean stop, after cleanly unmounting the drives, or SOMETIMES, it'll just start by itself, probably by some daemon believing it has magical powers to do something only it can do. Whatever this process is is what is causing kactivitymanager & plasmashell to go nuts, like I mentioned before, upwards of 20 minutes solid. 20 minutes of trying to open files and failing. Once I tried to appease it by mounting all the drives while kactivitymanager & plasmashell were going nuts, let it do it's magic, it did, and IT WORKED. Kactivitymanager was happy, plasmashell almost instantly returning to a low CPU-utilization rate. THE PROBLEM with that solutions, is after I let the drives settle down, & unmounted them as per my habit, except this time I had to do a fsck because they were marked as having a dirty unmount. During that time, there was nothing going on on the screen, no screen "animations" (I read about that bug, that was the first thing I tried, turning off all plasmoids & widgets (I had an analog clock widget (along with my usual windows, like konsole)) on my desktop's 2nd display screen) I guess I could wait the 20 minutes plasmashell likes to have all to itself, like paying street-rent to thugs so they won't slash your ties, but I'm not quite there yet. Oh, and yes, I have looked at all the logs for clues. This process doesn't leave a ready trail of hints about it's activity that I have found yet.

So the net is, I'm onto something, I just don't quite know exactly what it is, yet. I guess I have to take my "stupid" hat off, & dust off the old programming, debugging hat.

If I'm lucky, somebody'll read my diatribe and reply "Duh, Brain, It's <insert incredibly obvious answer here...>." and I can do <insert incredibly obvious solution here...> & thus I can keep my "stupid" hat comfortably hugging my noggin'.

Either that, or a PPA: will show up, or a apt-upgrade will fix it.
Mint 18.1; 7700K w/32GB mem., Asus Z270 MB, 128GB M.2 & 37TB SATA HDD, 4K & 2K mon, MX Revolution, Macbook Pro; 5 Laptops; 4 Tablets; Cisco routers & switch; Juniper SRX; 2 NAS; media server; 2 UPS w/diverse feeds; KRK near-field mon.

Brain
Level 1
Level 1
Posts: 16
Joined: Tue Mar 28, 2017 4:10 pm
Location: U.S.
Contact:

Re: Plasmashell high CPU bug #356479

Post by Brain » Wed Apr 12, 2017 5:04 am

Brain wrote:
braingateway wrote:Simple answer:
KDE5 has been released when it is still in alpha-test state :p
Simple solution:
Avoid KDE5

longer version:
2) I'm copying a file. That's it.
Did you try to turn off the animation at all? I never use desktop effect at all, doubt many people use it either.
This may be a GL related problem:
https://bugs.kde.org/show_bug.cgi?id=370003
Thus you can also try to disable openGL for desktop effect, or disable the Vsync of openGL.
Thank you for the suggestion on Vsync + openGL. I'll investigate that. I try not to use desktop effects, I try to turn them all off, but they pop-in automagically from time-to-time despite my efforts for reasons I've yet to discover, or resolve.

I read the bug report you link to. I understand the responders answer, I'm sure X is doing lots of I/O. I also agree with his "plasmashell bug" dumping-ground comment, as I think it my case it's kactivitymanager running something, but I've also had plasmashell up and do it by itself without kactivitymanager. The fallacy in his "blame the messenger" attitude is that you do a "top" & plasmashell is listed as the top user, so guess what? PLASMASHELL gets blamed. Duh. I also agree that killing plasmashell will bring it back in line. That works like a charm, but what kind of "solution" is that? The horse runs slowly, so you bring it to the vet and he says kill it and get a new horse? It kind of defeats the purpose of the vet, when all you need is a mortician and a better vet.

It's answers like that that make the world a worse place. You get them all the time. I was told to reinstall Windows to solve a driver update issue. They didn't check my logs, didn't ask any questions, didn't do any investigation: reinstall. It's the same answer as shooting the horse, or killing plasmashell. It isn't an actual solution, it's an admission of failure. I'm a lousy C programmer, it'd take me years to program a better plasmashell. Have you read some of the code? Most of it is obvious enough, it's just that there's so much of it! I think I'll leave that to the experts.

But their answer hints at a common problem: I/O. Whether it's screen updates, or file writes, it's I/O-related. File writes don't necessarily update the screen, nor do screen updates necessarily require file I/O. They both require memory & CPU usage, but it couldn't be a core problem because every desktop would suffer. Its something about I/O's interaction with the KDE desktop processes & underlying architecture.
Mint 18.1; 7700K w/32GB mem., Asus Z270 MB, 128GB M.2 & 37TB SATA HDD, 4K & 2K mon, MX Revolution, Macbook Pro; 5 Laptops; 4 Tablets; Cisco routers & switch; Juniper SRX; 2 NAS; media server; 2 UPS w/diverse feeds; KRK near-field mon.

Brain
Level 1
Level 1
Posts: 16
Joined: Tue Mar 28, 2017 4:10 pm
Location: U.S.
Contact:

Re: Plasmashell high CPU bug #356479

Post by Brain » Thu Apr 13, 2017 9:41 pm

I've done some more research on this. I haven't had kactivitymanager or plasmashell go crazy lately. Maybe it's coincidence, maybe it's related somehow to two recent changes I made:
1) I updated video drivers to newer (scary-bleeding-edge) ones.
2) I configured, compiled, & installed the new 4.10.0-rc6 kernel.

While plasmashell isn't going crazy right this very moment, it does have high CPU utilization. I'm compiling some code & running a few other things, pushing the CPU a little bit. I did an strace on plasmashell and what I saw were tons of messages scrolling by so fast they were unreadable. Mostly they were:

ioctl(15, DRM_IOCTL_I915_GEM_PWRITE, 0x{various hex numbers in a 12 digit string}) = 0

and a few

futex(0x13ac1d8, FUTEX_WAKE_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)

Dunno much about that stuff, but i915 is the video card driver used for my Intel HD 630 IGFX video.

There was nothing going on on the screen, not even the compiling konsole was visible, as I was on the phone with somebody & just letting these various processes run.

& regarding the whole openGL compositing v-sync thing, I'm running openGL 3.1 and vsynch is set to "never."
Mint 18.1; 7700K w/32GB mem., Asus Z270 MB, 128GB M.2 & 37TB SATA HDD, 4K & 2K mon, MX Revolution, Macbook Pro; 5 Laptops; 4 Tablets; Cisco routers & switch; Juniper SRX; 2 NAS; media server; 2 UPS w/diverse feeds; KRK near-field mon.

Hoser Rob
Level 11
Level 11
Posts: 3973
Joined: Sat Dec 15, 2012 8:57 am

Re: Plasmashell high CPU bug #356479

Post by Hoser Rob » Sat Apr 15, 2017 8:46 am

If the problems start with panel animations, why not just try disabling all desktop compositing?

Post Reply

Return to “KDE”