On Fri, 11 May 2012, Edgar Fu? wrote: > EF> I have one process doing something largely resulting in meta-data > EF> reads (i.e. traversing a very large directory tree). Will the kernel > EF> only issue sequential reads or will it be able to parallelise, e.g. > EF> reading indirect blocks? > GO> I don't know the answer to this off the top of my head... > Oops, any file-system experts round here?
It depends. To do any disk operation you need the disk address. Those are stored in the inode and indirect blocks. If you have all the relevent inodes in memory, the filesystem could issue all the reads in parallel. (Unlikely if it's just one process, since it will request one directory or even one directory entry at a time.) However, since ffs does clustering, it will probably try to read the entire directory (if it's contiguous 64KB or less) in one operation. That's true for all files. In general it won't access just one filesystem block. It will try to readahead 64KB unless you have disabled clustering on that filesystem. (Under normal circumstances it will also do 64KB write behind, but you're running NFS which has that restriction of hitting non-volatile storage before returning status, so I don't think the underlying filesystem can do clustering in that circumstance.) Eduardo