• Andrew Morton's avatar
    [PATCH] speed up readahead for seeky loads · b2768587
    Andrew Morton authored
    From: Ram Pai <linuxram@us.ibm.com>
    
    Currently the readahead code tends to read one more page than it should with
    seeky database-style loads.  This was to prevent bogus readahead triggering
    when we step into the last page of the current window.
    
    The patch removes that workaround and fixes up the suboptimal logic instead.
    
    
    wrt the "rounding errors" mentioned in this patch, Ram provided the following
    description:
    
      Say the i/o size is 20 pages.
    
      Our algorithm starts by a initial average i/o size of 'ra_pages/2' which
      is mostly say 16.
    
      Now every time we take a average, the 'average' progresses as follows
      (16+20)/2=18
      (18+20)/2=19
      (19+20)/2=19
      (19+20)/2=19.....
      and the rounding error makes it never touch 20
    
    
    
    Benchmarking sitrep:
    
    			IOZONE
    
    	run on a nfs mounted filesystem:
    	client machine 2proc, 733MHz, 2GB memory
    	server machine 8proc, 700Mhz, 8GB memory
    
    ./iozone -c -t1 -s 4096m -r 128k
    b2768587
readahead.c 16.6 KB