By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 3199 - TDE Hardware Manager is VERY slow and mostly completely freezes
Summary: TDE Hardware Manager is VERY slow and mostly completely freezes
Status: PATCHAVAIL
Alias: None
Product: TDE
Classification: Unclassified
Component: tdebase (show other bugs)
Version: R14.0.x [Trinity]
Hardware: Other Linux
: P5 major
Assignee: Timothy Pearson
URL:
Depends on:
Blocks:
 
Reported: 2023-02-20 10:18 CST by Roman Savochenko
Modified: 2023-03-25 01:40 CDT (History)
2 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments
hwmanager-NoFreeze.patch (688 bytes, patch)
2023-02-20 10:18 CST, Roman Savochenko
Details | Diff
tdehw-NoFreeze.patch (4.63 KB, patch)
2023-03-25 01:38 CDT, Roman Savochenko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Savochenko 2023-02-20 10:18:32 CST
Created attachment 3048 [details]
hwmanager-NoFreeze.patch

I have got such behaviour at least on two modern enough hardware environments Intel(R) Core(TM) i7-5600U and AMD A8-6500 APU. So, once I enter to HM, that freezes mostly.

That is related seems with reading some hardware in long time and if I comment that link in the file /kcontrol/hwmanager/hwmanager.cpp, I get the slow work, but that isn't the complete freeze:
connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*)));
Comment 1 Roman Savochenko 2023-03-25 01:38:35 CDT
Created attachment 3052 [details]
tdehw-NoFreeze.patch

As me learned the issue deeply, this problem is in tdelibs/tdecore/tdehw, in the class TDEHardwareDevices of the files tdehardwaredevices.{h,cpp}. In the Timer invokes processModifiedCPUs() and processStatelessDevices() which are called in the main Qt GUI thread, with fixed small intervals and consume many time even on powerful hardware:
• processModifiedCPUs() up to 200ms (40%);
• processStatelessDevices() up to 1s (50%) without the notification and WHOLE Timer cycle with notification tdebase/kcontrol/hwmanager.

That is a BAD practice and if you call such functions in the main Qt GUI thread, you must whether to limit the functions time, doing only some part of all works, what I have added to processStatelessDevices(), or to stretch the Timer interval dynamically, what I have added to processModifiedCPUs(). And the first way is a preferable one and must be implemented for processModifiedCPUs() also.