jpalecek created this revision. Herald added a project: Plasma. Herald added a subscriber: plasma-devel. jpalecek requested review of this revision.
REVISION SUMMARY On Linux, it may happen that two mounts are mounted to the same mount point. Two different devices or the same device twice, doesn't matter. As it currently is, ksysguardd handles this case badly. When updating sensors, the checkDiskStat fuction searches the previously known mounts for the items from the current list, by comparing the mount points only. If found, the item from the old list is deleted and the new item is deemed to be preexisting. However, if there are two items with the same mountpoint, both get deleted on the first occurence of the mountpoint in the list. Therefore, the second one doesn't have any corresponding "old" entry, and is deemed to be newly existing. This means that ksysguardd signals to its client that there are new sensors, and, atop of that, registers the "new" monitors. This eventually leads to the list of monitors expanding to tens of thousands of items. This can cause quite a cpu load eg. in Plasma. This patch changes the logic so that every mount will only delete one corresponding item from the old list. Thus, the bloat of the list of sensors, at least in case of disk sensors, is prevented. Part of T11473: #407526: plasma + ksysguardd causing high cpu load <https://phabricator.kde.org/T11473>. REPOSITORY R106 KSysguard BRANCH master REVISION DETAIL https://phabricator.kde.org/D23592 AFFECTED FILES ksysguardd/Linux/diskstat.c To: jpalecek Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart