From: David S. <ds...@ja...> - 2005-02-22 16:24:13
|
On Tue, Feb 22, 2005 at 04:53:21PM +0100, Miklos Szeredi wrote: > > > It should be fairly easy to do by letting the cache in libfuse grow > > > unlimited. If you can tolerate this (e.g. the number of files in the > > > filesystem is limited to about ten-twenty thousand), then I think > > > there's no problem. > > > > Is there any way to cache files until some specified limit is reached, > > and then drop files in a LRU way or even just FIFO? Then, the limit > > would be 10-20,000 files being used at a time, rather than a limit for > > the whole filesystem. > > Note, a hard limit wouldn't be needed, it would just start to get > inefficient beyond 20,000, and if files can disappear from under FUSE, > it could possibly mean a memory leak, since even removed files > wouldn't ever be purged from the cache. > > But adding an LRU list doesn't sound too complicated either. Only > this solution would mean that you could still get ESTALE errors if the > filesystem goes over the limit. Yes, that is true, but I'd prefer that to a potential memory leak (since in my usage, files can disappear from under FUSE). Also, it seems proper that the user can decide the right balance between memory usage and how likely an ESTALE is by choosing the cache size. David |