On Fri, 2009-01-16 at 09:27 +0900, Ian Kent wrote:
> On Fri, 2009-01-16 at 07:57 +1100, Paul Wankadia wrote:
> > On 1/16/09, Jeff Moyer <jmo...@redhat.com> wrote:
> > 
> > > My argument is that you're not really saving much.  Just cache the whole
> > > file.  I agree that you probably want to detect changes, still.  For
> > > that, you can use mtime or inotify.  You could make a case for either
> > > side, though I think I'd argue for keeping the mtime approach (as the
> > > map may change multiple times before we actually try to read it, and
> > > doing the read in the lookup path really shouldn't be that big of a
> > > deal).  Of course, I haven't profiled this, so that may be worth doing.
> > 
> > If we can simply flag the cached version as stale, then lazy reloads
> > should be possible.
> 
> Maybe not.
> 
> The layer of code above the lookup modules does the re-loads but it is
> general wrt. the map type so for a "nobrowse" map it won't read the map.
> I'm not sure yet that putting special case exceptions in that code is a
> good thing to do or even straight forward. But, for the large map case,

Or maybe I'm talking nonsense as it looks like I've actually got plenty
of map type context in the layer above, hehe.

> we can consider reading the entire map an expensive operation, so if we
> did change the layer above and we found the map needed to be modified
> then marked the map as stale we would need to scan the file map for the
> key (as the map is out of date) and then read the whole map later. That
> means we would end up reading the map at least one and a half times (on
> average) instead of once (assuming no lookups between marking the map
> stale and re-reading).
> 
> I'm tending toward reading the map during the lookup so the map is up to
> date when we look for the key in the cache.
> 
> Ian
> 
> 
> _______________________________________________
> autofs mailing list
> autofs@linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/autofs

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to