Re: [AVFS] Updated extfs and a minor problem with the cache

Miklos Szeredi <[email protected]> Fri, 17 Jun 2005 10:10:21 +0200
Newsgroups gmane.comp.file-systems.avfs.user
Message-ID <[email protected]>
> I encountered a performance problem with the cache. When copying a file
> from a remote site (ftp or ssh), it takes much longer when the file is
> larger than the cache limit (by default 100MB). I found out that the
> file is transfered twice. First the file is read and stored in the
> cache. After completion av_cacheobj_setsize() is called which will
> remove the file again because it's larger than the cache limit. So when
> a program does the last read() call to expect 0 bytes (file end), the
> whole file is transfered again.

Hmm, yes.  Ugly.

> I changed the behaviour of deleting an entry when the cache is full.
> cache_checkspace() is now not called when setting the size of an entry
> with av_cacheobj_setsize() but at the beginning of av_cacheobj_new() so
> the tmp file is kept until a new cache file is requested (although the
> file is larger than the cache limit, the file is on the disc already so
> why remove it). I don't see any problem with this minor change and it
> works fine but you know the cache code better so if this breaks
> something we should thing about another solution.

I think calling cache_checkspace() was meant to clean up other objects
from the cache, not the one for which av_cacheobj_setsize() was
called.  So maybe you could give the cobj parameter to
cache_checkspace() (and pass NULL in all other calls), and in
cache_free_one() ignore the cobj if non-NULL.

> With the last commit I also updated the extfs. I wasn't able to test
> everything single extension but the few I tested work fine.
> There is also some small changes to the automake files so "make
> distcheck" also works.
> 
> What do you think about releasing a new version?

Good idea.  Would you like to do it?

Thanks,
Miklos


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click