aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2009-06-16 18:31:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 22:47:29 -0400
commitd30a11004e3411909f2448546f036a011978062e (patch)
treec1980adb410d9fabd2c2eb8af9f0ed8ee4b656da /mm/filemap.c
parent2fad6f5deee5556f511eab58da78737a23ddb35d (diff)
readahead: record mmap read-around states in file_ra_state
Mmap read-around now shares the same code style and data structure with readahead code. This also removes do_page_cache_readahead(). Its last user, mmap read-around, has been changed to call ra_submit(). The no-readahead-if-congested logic is dumped by the way. Users will be pretty sensitive about the slow loading of executables. So it's unfavorable to disabled mmap read-around on a congested queue. [akpm@linux-foundation.org: coding-style fixes] Cc: Nick Piggin <npiggin@suse.de> Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn> Cc: Ying Han <yinghan@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 5c0c6518f341..734891d0663d 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1488,13 +1488,15 @@ static void do_sync_mmap_readahead(struct vm_area_struct *vma,
1488 if (ra->mmap_miss > MMAP_LOTSAMISS) 1488 if (ra->mmap_miss > MMAP_LOTSAMISS)
1489 return; 1489 return;
1490 1490
1491 /*
1492 * mmap read-around
1493 */
1491 ra_pages = max_sane_readahead(ra->ra_pages); 1494 ra_pages = max_sane_readahead(ra->ra_pages);
1492 if (ra_pages) { 1495 if (ra_pages) {
1493 pgoff_t start = 0; 1496 ra->start = max_t(long, 0, offset - ra_pages/2);
1494 1497 ra->size = ra_pages;
1495 if (offset > ra_pages / 2) 1498 ra->async_size = 0;
1496 start = offset - ra_pages / 2; 1499 ra_submit(ra, mapping, file);
1497 do_page_cache_readahead(mapping, file, start, ra_pages);
1498 } 1500 }
1499} 1501}
1500 1502