Bug 254813

Summary: Disable disk space checks when idle
Product: nepomuk Reporter: Orion Poplawski <orion>
Component: generalAssignee: Sebastian Trueg <sebastian>
Status: RESOLVED FIXED    
Severity: normal CC: trueg
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Orion Poplawski 2010-10-21 00:13:26 UTC
Version:           unspecified (using KDE 4.5.2) 
OS:                Linux

When the strigi indexer is idle, it still continually polls every 20 seconds to check the available disk space.  This is unnecessary when idle and simply generates unnecessary os wakeups.  Ideally the timer would be turned off completely in the case that it is idle for any reason other than disk space.

Also, this might work to reduce the number of stat() calls by about 4 each time it is called.  Completely untested.

--- eventmonitor.cpp.space      2010-04-28 02:01:04.000000000 -0600
+++ eventmonitor.cpp    2010-10-20 15:57:31.388194067 -0600
@@ -104,7 +104,8 @@
 
 void Nepomuk::EventMonitor::slotCheckAvailableSpace()
 {
-    KDiskFreeSpaceInfo info = KDiskFreeSpaceInfo::freeSpaceInfo( KStandardDirs::locateLocal( "data", "nepomuk/repository/", false ) );
+    static KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath( KStandardDirs::locateLocal( "data", "nepomuk/repository/", false ) );
+    KDiskFreeSpaceInfo info = KDiskFreeSpaceInfo::freeSpaceInfo( mp->mountPoint() );
     if ( info.isValid() ) {
         if ( info.available() <= StrigiServiceConfig::self()->minDiskSpace() ) {
             if ( m_indexScheduler->isRunning() &&


Reproducible: Always
Comment 1 Sebastian Trueg 2010-11-01 19:24:46 UTC
Your patch does not make any difference since the exact code path is called using the exact same amount of stats.
However, the suggestion to not check the free disk space makes A LOT of sense. Stay tuned for a commit.
Comment 2 Sebastian Trueg 2010-11-01 19:58:01 UTC
SVN commit 1192034 by trueg:

Suspend the available disk space polling while the indexer is idle. Restart it when the indexing continues.
BUG: 254813

 M  +20 -1     eventmonitor.cpp  
 M  +1 -0      eventmonitor.h  
 M  +1 -0      indexscheduler.cpp  
 M  +2 -0      indexscheduler.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1192034