<table><tr><td style="">jpalecek created this revision.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />jpalecek requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D23592">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>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.</p>

<p>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.</p>

<p>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.</p>

<p>Part of <a href="https://phabricator.kde.org/T11473" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">T11473: #407526: plasma + ksysguardd causing high cpu load</a>.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R106 KSysguard</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D23592">https://phabricator.kde.org/D23592</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>ksysguardd/Linux/diskstat.c</div></div></div><br /><div><strong>To: </strong>jpalecek<br /><strong>Cc: </strong>plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>