Bug 155148

Summary: kdesysguardd polls /etc/mtab every second
Product: [Applications] ksysguard Reporter: idisfr
Component: ksysguarddAssignee: KSysGuard Developers <ksysguard-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: csw
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:

Description idisfr 2008-01-05 16:46:04 UTC
Version:            (using KDE KDE 3.5.8)
Installed from:    Debian testing/unstable Packages
OS:                Linux

I'm just using the ksysguard applet to display my laptop's battery charge and the cpu charge (both refresh at 4s interval)

With that setup, doing strace on ksysguardd reveals that it stats /etc/mtab every second

select(1, [0], NULL, NULL, {0, 995127}) = 0 (Timeout)
gettimeofday({1199546864, 37105}, NULL) = 0
stat64("/etc/mtab", {st_mode=S_IFREG|0644, st_size=431, ...}) = 0
select(1, [0], NULL, NULL, {1, 0})      = 0 (Timeout)
gettimeofday({1199546865, 38075}, NULL) = 0
stat64("/etc/mtab", {st_mode=S_IFREG|0644, st_size=431, ...}) = 0
select(1, [0], NULL, NULL, {1, 0} <unfinished ...>

There are two points here:
- why poll mtab while no display is related to disk use? That polling should maybe happen when mtab specific info is needed

- there may be cleaner ways to do this with i.e. inotify on linux or less intrusive polling (1/s is offensive according to my powertop use)
Comment 1 John Tapsell 2008-01-05 20:02:47 UTC
SVN commit 757733 by johnflux:

Do not wakeup every second to check whether new disks have been added.

BUG:155148


 M  +3 -30     ksysguardd.c  


WebSVN link: http://websvn.kde.org/?view=rev&revision=757733
Comment 2 John Tapsell 2008-01-05 20:46:51 UTC
SVN commit 757746 by johnflux:

Use inotify to check for mtab changes
CCBUG:155148


 M  +41 -4     ksysguardd.c  


WebSVN link: http://websvn.kde.org/?view=rev&revision=757746
Comment 3 Christian Schuerer 2012-02-21 19:36:40 UTC
Hi John, you have fixed this issue by using inotify. I'm running KDE 4.8 (Kubuntu 12.04) and still seeing a lot of file accesses to /etc/mtab by kdesysguardd. Has the usage of inotify been removed recently?