File IO performance

Date: Wed Feb 14 2001 - 07:47:52 EST

I have been performing some IO tests under Linux on SCSI disks.
I noticed gaps between the commands and decided to investigate.
I am new to the kernel and do not profess to underatand what
actually happens. My observations suggest that the file
structured part of the io consists of the following file phases
which mainly reside in mm/filemap.c . The user read call ends up in
a generic file read routine. If the requested buffer is not in
the file cache then the data is requested from disk via the disk
readahead routine. When this routine completes the data is copied
to user space. I have been looking at these phases on an analyzer
and it seems that none of them overlap for a single user process.

This creates gaps in the scsi commands which significantly reduce
bandwidth, particularly at todays disk speeds.

I am interested in making changes to the readahead routine. In this
routine there is a loop

 /* Try to read ahead pages.
  * We hope that ll_rw_blk() plug/unplug, coalescence, requests sort
  * and the scheduler, will work enough for us to avoid too bad
  * actuals IO requests.

 while (ahead < max_ahead) {
  ahead ++;
  if ((raend + ahead) >= end_index)
  if (page_cache_read(filp, raend + ahead) < 0)

this whole loop completes before the disk command starts. If the
commands are large and it is for a maximum read ahead this loops
takes some time and is followed by disk commands.

It seems that the performance could be improved if the disk commands
were overlapped in some way with the time taken in this loop. I have
not traced page_cache_read so I have no idea what is happening but I
guess this is some page location and entry onto the specific device
buffer queues ?

I am really looking for some help in underatanding what is happening
here and suggestions in ways which operations may be overlapped.

Simon Haynes - Baydel
Phone : 44 (0) 1372 378811
Email :
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Feb 15 2001 - 21:00:24 EST