readv: parallel or sequential?

Bernd Walter ticso at cicely12.cicely.de
Fri Dec 7 09:49:26 PST 2007


On Fri, Dec 07, 2007 at 03:16:30PM +0100, Ivan Voras wrote:
> Bernd Walter wrote:
> 
> > I wonder if the kernel can read a single file in parallel, because
> > disk heads can't be on multiple positions at the same time.
> 
> They can be in case of RAID0 and similar schemes.

Yes, but how can it now that it is on a RAID0 and taking advantage of
multiple spindles instead of making it worse?
The FS has to do sensible things for single spindle as well.
And normaly disks are fastest when reading linear and with disk read
caches this doesn't even have to be interleaved.
I don't see any potential for parallell access within the same file
beside some special constructed cases maybe.
Granted if you issue many access in parallel you allow the disk queue
to sort them in the most effective way, but most FS do a hard job
getting single files almost linear, so there is no seek time win at all.
I assume the best is the application sorting the readv entries in an
increasing order.

> > ZFS does fill read cache in parallel if it knowns that there are enough
> > spindels, but in every other case the FS doesn't know about multiple
> > spindels.
> > In case of ZFS you don't have to care much about it in you application
> > because the next sequentiel fileread will use the previously parallel
> > prefilled cache.
> 
> Yes, ZFS is supposed to be doing marvelous things with IO prediction and
> scheduling, but I think even basic "ladder" scheduling done in FreeBSD
> could in theory help in tight spots with multiple requests.

At least there are some workloads with very good results.
A friend recently measured almost twice the speed when reading a big
file on a two disk ZFS mirror compared to single disk raw speed.

-- 
B.Walter                http://www.bwct.de      http://www.fizon.de
bernd at bwct.de           info at bwct.de            support at fizon.de


More information about the freebsd-fs mailing list