Bug 437259 - CGroup check in audio indicator causes massive slowdowns
Summary: CGroup check in audio indicator causes massive slowdowns
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: 5.21.90
Platform: Other Linux
: VHI major
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords: regression
: 436947 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-05-17 15:17 UTC by Kai Uwe Broulik
Modified: 2021-05-17 18:24 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.22.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Uwe Broulik 2021-05-17 15:17:17 UTC
The audio indicator now checks whether the parent process is in the same cgroup to avoid showing the indicator e.g. on a Dolphin window that spawned a VLC player. However, that KSysguard stuff is super slow

STEPS TO REPRODUCEv
1. Receive a Telegram notification or start playing a video in your browser

OBSERVED RESULT
Plasma freezes for a few seconds

EXPECTED RESULT
Plasma does not freeze

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: git master as of 2021-05-17

ADDITIONAL INFORMATION
Also causes a noticeable freeze on startup when taskbar widget appears. Or just starting VLC player. It does not happen with VLC player when pause/unpause becuase the Audio stream stays. It's only when a new Audio stream is created, e.g. starting a video in the browser.

Offending code https://invent.kde.org/plasma/plasma-desktop/-/blob/master/applets/taskmanager/plugin/backend.cpp#L558
Comment 1 Nate Graham 2021-05-17 15:19:50 UTC
Can reproduce. So this is what's been causing those slowdowns I've been experiencing lately!

Reverting c59edc9826a64c51f9ed41f7ccaf2cc5ade86d4b (in plasma-desktop) fixes the issue immediately.

I guess we need to figure out a less-performance-heavy way to fix Bug 417457.
Comment 2 Nate Graham 2021-05-17 15:23:00 UTC
Marking as VHI; we need to fix this or revert c59edc9826a64c51f9ed41f7ccaf2cc5ade86d4b before the final release of Plasma 5.22.
Comment 3 Patrick Silva 2021-05-17 15:50:18 UTC
bug 436947 seems related.
Comment 4 Nate Graham 2021-05-17 16:23:21 UTC
Yep, definitely the same issue.
Comment 5 Nate Graham 2021-05-17 16:23:25 UTC
*** Bug 436947 has been marked as a duplicate of this bug. ***
Comment 6 Bug Janitor Service 2021-05-17 17:06:04 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/479
Comment 7 Kai Uwe Broulik 2021-05-17 18:13:30 UTC
Git commit 7bfb5570eb0f3434eceb6641cb796573bf93b9f7 by Kai Uwe Broulik.
Committed on 17/05/2021 at 17:03.
Pushed by broulik into branch 'master'.

[Task Manager] Optimize parent process CGroup check

There's no need to update all processes when we can just explicitly add
info about the parent process.
FIXED-IN: 5.22.0

M  +2    -5    applets/taskmanager/plugin/backend.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/7bfb5570eb0f3434eceb6641cb796573bf93b9f7
Comment 8 Nate Graham 2021-05-17 18:24:17 UTC
Git commit 4cd6ae59ca3949a6d96c4730ffefb60b8c76e9af by Nate Graham, on behalf of Kai Uwe Broulik.
Committed on 17/05/2021 at 18:24.
Pushed by ngraham into branch 'Plasma/5.22'.

[Task Manager] Optimize parent process CGroup check

There's no need to update all processes when we can just explicitly add
info about the parent process.
FIXED-IN: 5.22.0


(cherry picked from commit 7bfb5570eb0f3434eceb6641cb796573bf93b9f7)

M  +2    -5    applets/taskmanager/plugin/backend.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/4cd6ae59ca3949a6d96c4730ffefb60b8c76e9af