https://bugs.kde.org/show_bug.cgi?id=526596
Bug ID: 526596
Summary: libksysguard: unsubscribed sensors are subscribed
again after ksystemstats restarts
Classification: Frameworks and Libraries
Product: ksystemstats
Version First 6.7.5
Reported In:
Platform: NixOS
OS: Linux
Status: REPORTED
Severity: minor
Priority: NOR
Component: General
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
Created attachment 196794
--> https://bugs.kde.org/attachment.cgi?id=196794&action=edit
QML reproducer; run with "-- disable": disables the Sensor after 5 s, then
restart ksystemstats
DESCRIPTION
When ksystemstats restarts, libksysguard subscribes again to every sensor the
process has ever subscribed to, including sensors that were unsubscribed in the
meantime. On an NVIDIA laptop this brings back `nvidia-smi dmon` and the dGPU
stops runtime-suspending.
STEPS TO REPRODUCE
1. On a system with an NVIDIA GPU, make sure nothing else uses gpu/gpu0 sensors
(no nvidia-smi process running).
2. Run the attached libksysguard-stale-subscriptions.qml with `qml
libksysguard-stale-subscriptions.qml -- disable`. It creates a Sensor for
gpu/gpu0/usage and sets enabled to false after 5 seconds.
3. Check that nvidia-smi dmon has stopped.
4. Run `systemctl --user restart plasma-ksystemstats` while the qml process is
still running.
OBSERVED RESULT
After step 3 nvidia-smi dmon is stopped, as expected. After the restart in step
4 it starts again, although the only Sensor is disabled.
EXPECTED RESULT
Only sensors that are still in use are subscribed again after ksystemstats
restarts.
SOFTWARE/OS VERSIONS
Operating System: NixOS 26.11
KDE Plasma Version: 6.7.5
KDE Frameworks Version: 6.30.0
Qt Version: 6.11.2
Kernel Version: 7.2.8 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 260 w/ Radeon 780M Graphics
Memory: 24 GiB of RAM (22.8 GiB usable)
Graphics Processor 1: AMD Radeon 780M Graphics
Graphics Processor 2: NVIDIA GeForce RTX 5050 Laptop GPU
libksysguard / ksystemstats: 6.7.5
NVIDIA driver: 615.71.09 (open kernel module), PRIME offload with runtime D3
power management
ADDITIONAL INFORMATION
Filed under ksystemstats because I could not find a libksysguard product.
In sensors/SensorDaemonInterface.cpp, subscribe() appends ids to
d->subscribedSensors, but unsubscribe() never removes them. reconnect(), which
runs when the ksystemstats service goes away, subscribes the whole list again.
So every sensor the process has ever subscribed comes back. Same code on
master.
In practice this happens when ksystemstats restarts while plasmashell keeps
running, e.g. after a system update. On my NVIDIA laptop plasmashell then
subscribes the GPU sensors again, nvidia-smi keeps running and the dGPU stays
out of D3cold (about 7 W extra on battery). Related: bug 497024.
--
You are receiving this mail because:
You are watching all bug changes.