Re: [RFC] [PATCH 3/3] Recursive mtime for ext3

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jan Kara
Date: Wednesday, November 7, 2007 - 7:36 am

On Tue 06-11-07 14:40:12, Theodore Tso wrote:
  That should be fine - let's see: Each application keeps somewhere a time when
it started a scan of a subtree (or it can actually remember a time when it
set the flag for each directory), during the scan, it sets the flag on
each directory. When it wakes up to recheck the subtree it just compares
the rtime against the stored time - if rtime is greater, subtree has been
modified since the last scan and we recurse in it and when we are finished
with it we set the flag. Now notice that we don't care about the flag when
we check for changes - we care only for rtime - so if there are several
applications interested in the same subtree, the flag just gets set more
often and thus the update of rtime happens more often but the same scheme
still works fine.

  I don't get it here - you need to scan the whole subtree and set the flag
only during the initial scan. Later, you need to scan and set the flag only
for directories in whose subtree something changed. Similarty rtime needs
to be updated for each inode at most once after the scan. Maybe we have
different different ideas of use-cases: I consider this useful for larger
subtrees which change only seldom (or only their small parts) or you want
to check for changes only once per some longer time - so uses like backup
with rsync, updatedb, cachefiles for trees with config files (like KDE has)
etc. There the penalty for additional IO is during rtime updates is quite
negligible - if you have some usecase you'd like to measure, please propose
it and I'll measure it. I have tested the following:
  Create a tree of depth 5 where each directory has 5 subdirectories and
the leaf directories have 10 files in it. You set the flag on all
directories (umount and mount again) and then touch one file in every directory.
  With the feature enabled this takes 36.1176s (average from 5 tests) with
deviation 0.29509. Without the feature it takes 35.75480 with deviation
0.15433. So the difference in performance is 1% which is just slightly
above the error and I'd find this test case quite pesimistic for the
intended usage... 

  I don't quite understand what you are afraid here - I think we
misunderstand a bit - are you aware that we don't propagate the
modification up once we hit a directory with a flag not set - hence all
possible updates in future will write each inode at most once? 

  I hope I've refuted most of your objections ;) Thanks for having look
at the feature.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] [PATCH 0/3] Recursive mtime for ext3, Jan Kara, (Tue Nov 6, 10:15 am)
[RFC] [PATCH 1/3] Recursive mtime for ext3, Jan Kara, (Tue Nov 6, 10:18 am)
[RFC] [PATCH 2/3] Recursive mtime for ext3, Jan Kara, (Tue Nov 6, 10:19 am)
[RFC] [PATCH 3/3] Recursive mtime for ext3, Jan Kara, (Tue Nov 6, 10:19 am)
Re: [RFC] [PATCH 3/3] Recursive mtime for ext3, Arjan van de Ven, (Tue Nov 6, 10:40 am)
Re: [RFC] [PATCH 3/3] Recursive mtime for ext3, Al Viro, (Tue Nov 6, 11:01 am)
Re: [RFC] [PATCH 3/3] Recursive mtime for ext3, H. Peter Anvin, (Tue Nov 6, 11:04 am)
Re: [RFC] [PATCH 3/3] Recursive mtime for ext3, Theodore Tso, (Tue Nov 6, 12:40 pm)
Re: [RFC] [PATCH 3/3] Recursive mtime for ext3, Jan Kara, (Wed Nov 7, 4:51 am)
Re: [RFC] [PATCH 3/3] Recursive mtime for ext3, Jan Kara, (Wed Nov 7, 7:36 am)
Re: [RFC] [PATCH 3/3] Recursive mtime for ext3, Jan Kara, (Wed Nov 7, 7:54 am)
Re: [RFC] [PATCH 3/3] Recursive mtime for ext3, Theodore Tso, (Wed Nov 7, 5:20 pm)
Re: [RFC] [PATCH 3/3] Recursive mtime for ext3, Jan Kara, (Thu Nov 8, 3:56 am)
Re: [RFC] [PATCH 3/3] Recursive mtime for ext3, Theodore Tso, (Thu Nov 8, 7:37 am)
Re: [RFC] [PATCH 3/3] Recursive mtime for ext3, Jan Kara, (Thu Nov 8, 8:28 am)