mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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. [[email protected]: coding-style fixes] Cc: Nick Piggin <[email protected]> Signed-off-by: Fengguang Wu <[email protected]> Cc: Ying Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
2fad6f5dee
commit
d30a11004e
3 changed files with 12 additions and 28 deletions
12
mm/filemap.c
12
mm/filemap.c
|
|
@ -1488,13 +1488,15 @@ static void do_sync_mmap_readahead(struct vm_area_struct *vma,
|
|||
if (ra->mmap_miss > MMAP_LOTSAMISS)
|
||||
return;
|
||||
|
||||
/*
|
||||
* mmap read-around
|
||||
*/
|
||||
ra_pages = max_sane_readahead(ra->ra_pages);
|
||||
if (ra_pages) {
|
||||
pgoff_t start = 0;
|
||||
|
||||
if (offset > ra_pages / 2)
|
||||
start = offset - ra_pages / 2;
|
||||
do_page_cache_readahead(mapping, file, start, ra_pages);
|
||||
ra->start = max_t(long, 0, offset - ra_pages/2);
|
||||
ra->size = ra_pages;
|
||||
ra->async_size = 0;
|
||||
ra_submit(ra, mapping, file);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue