readv: parallel or sequential?

Bernd Walter ticso at cicely12.cicely.de
Thu Dec 20 14:35:41 PST 2007


On Thu, Dec 20, 2007 at 02:25:21PM -0800, Julian Elischer wrote:
> Bernd Walter wrote:
> >On Thu, Dec 20, 2007 at 09:40:00PM +0100, Peter Schuller wrote:
> >>>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.
> >>I strongly disagree here. I would expect the operating system to not 
> >>serialize all I/O to the same file descriptor/file, if done in paralell 
> >>from multiple threads or through AIO. I have at least on use case heavily 
> >>dependent on this - does this mean FreeBSD would not be usable for this?
> >
> >No - I just didn't though about this.
> >In most cases a single file means serialized use from the application,
> >but of course this is not true in every case.
> >In case the application uses serialized access there is not much to do
> >beside preread or caching writes to make use of multiple spindles.
> >But an application has to be carefull, because parallel access within
> >a single file almost always mean that access is not linear anymore, so
> >many opther performance tunings won't work as good as they could, so
> >this could easily outweight the performance gain from multiple access.
> >Nonlinear access from within an application has to be for another reason
> >and not as a performance tuning.
> 
> If you want to write to different points in a file you can always open
> multiple file descriptors to the same file.

Or mmap the file and access it with multiple threads.

> All IO to a single descriptor MUST be serialised.

-- 
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