Review Request 111462: Avoid unnecessary stat of destination directory during copy/move in KDirWatch

Dawit Alemayehu adawit at kde.org
Mon Jul 15 00:57:57 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111462/
-----------------------------------------------------------

(Updated July 14, 2013, 11:57 p.m.)


Review request for kdelibs and David Faure.


Changes
-------

Changed the patch to only prevent unnecessary stat of the destination directory during copy/move operations.


Summary (updated)
-----------------

Avoid unnecessary stat of destination directory during copy/move in KDirWatch


Description
-------

The attached patch changes the logic that attempts to deal with a flood of the dirty signals received by KDirLister when existing files are change. The current code simply puts the file in an update pending list and starts a delayed timer (500 ms) to process the request. As a result, every half a second or so the pending update request is processed. This would have been fine were it not for the fact that the processing results in a call to KFileItem::refersh which does a stat the local file. Hence, a stat is done on the file being downloaded every 500 ms. Additionally, some other code is also doing a stat every half second on the download destination directory as well.

This patch attempts to prevent the flood of stat calls by restarting the update timer if we get another dirty signal on a file that is already in the update pending list. IOW, we only do the last stat call. The downside of doing that is the information about the file being download will be stale until the download finishes. Unfortunately I still have not been able to figure out what is doing the stat on the destination directory itself and hence do not have a solution for that yet. Any ideas?


Diffs (updated)
-----

  kdecore/io/kdirwatch.cpp a325f0f 

Diff: http://git.reviewboard.kde.org/r/111462/diff/


Testing
-------

- strace an instance of Konqueror or Dolphin.
- copy a file from a remote location (ftp,sftp, smb) to your local file system.
- check if there is a flood of stat calls on both the file being copied and its destination directory.


Thanks,

Dawit Alemayehu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20130714/cefd0d9b/attachment.htm>


More information about the kde-core-devel mailing list