readahead: improve heuristic detecting sequential reads
authorJan Kara <jack@suse.cz>
Sun, 6 May 2007 21:49:25 +0000 (14:49 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 7 May 2007 19:12:52 +0000 (12:12 -0700)
commitec0f16372277052a29a6c17527c6cae5e898b3fd
tree35636edac6ed01baf301f3aca96f090caae82c9d
parentb813e931b4c8235bb42e301096ea97dbdee3e8fe
readahead: improve heuristic detecting sequential reads

Introduce ra.offset and store in it an offset where the previous read
ended.  This way we can detect whether reads are really sequential (and
thus we should not mark the page as accessed repeatedly) or whether they
are random and just happen to be in the same page (and the page should
really be marked accessed again).

Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: WU Fengguang <wfg@mail.ustc.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/fs.h
mm/filemap.c
mm/readahead.c