(Illustration by Gaich Muramatsu)
Hello Dhaivat and Greg, On Sat, Nov 24, 2012 at 07:34:45PM -0500, Greg Troxel wrote: > Prefetching and caching are quite different. Venus will cache files > that it reads, either due to VFS requests or hoarding. I am unaware of > any prefetching. For example, one could have venus read (into the Right. Venus does not do anything like that. Unfortunately some not-so-bright file managers do (e.g. under Windows but Linux GUI file managers are known to do similar things). This is a major PITA as the file manager tries to prepare the view for the user in advance, no matter where the user would look from the current point in the file system. I guess this is supposed to create a feeling of the system being "fast". :-b In reality this spectacularly fails on Coda as "opening" a file to peek at it and even doing stat()s in advance can be a costly operation. Look at codacon while trying to access a file in Windows - you will see that Venus most probably will fetch attrs of all files in the same directory and even in subdirectories (this can be a lot!). This takes a lot of time and is not Venus fault or intention. Prefetching without a detailed knowledge of the data expected to be accessed in the future is a huge loss. The file system layer does not prerequisites for doing a good guess. Even applications usually do not know - otherwise they can easily let Venus prefetch a file (open()-ing it in advance, asynchronously). > Before doing this, I'd want to have some sort of priority queueing by > request uid or reason, so that prefetches don't compete with real > requests. And probably analyze some traces, although user behavior > adapts to FS behavior, so the actual question of what's best is far > trickier than it might at first seem. My conclusion based on my experience (YMMV) is that lazy fetching is a very efficient strategy. Given the "high cost" of accessing a file without a reason, the less prefetching the better. Application-level prefetching is a different story and _sometimes_ might make things better, but it is not a file system business. Regards, RuneReceived on 2012-11-25 12:19:32