]> git.hungrycats.org Git - linux/commit
[PATCH] speed up readahead for seeky loads
authorAndrew Morton <akpm@osdl.org>
Wed, 19 May 2004 09:34:12 +0000 (02:34 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 19 May 2004 09:34:12 +0000 (02:34 -0700)
commitb27685872d1493caefe5c2d321291cca61a5bb25
treeefecef66e67bd507c06c2d861712a32275125c77
parentf71e41846ae370747a3c1c584c93872050085bb2
[PATCH] speed up readahead for seeky loads

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
mm/readahead.c