Commit 2fd50585 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] readahead part-backout

From: Ram Pai <linuxram@us.ibm.com>

Remove the up-front readahead code from the core pagecache read
function: it's really bad for large reads.
parent f1933a6d
......@@ -587,22 +587,13 @@ void do_generic_mapping_read(struct address_space *mapping,
read_actor_t actor)
{
struct inode *inode = mapping->host;
unsigned long index, offset, last;
unsigned long index, offset;
struct page *cached_page;
int error;
cached_page = NULL;
index = *ppos >> PAGE_CACHE_SHIFT;
offset = *ppos & ~PAGE_CACHE_MASK;
last = (*ppos + desc->count) >> PAGE_CACHE_SHIFT;
/*
* Let the readahead logic know upfront about all
* the pages we'll need to satisfy this request
*/
for (; index < last; index++)
page_cache_readahead(mapping, ra, filp, index);
index = *ppos >> PAGE_CACHE_SHIFT;
for (;;) {
struct page *page;
......@@ -621,6 +612,7 @@ void do_generic_mapping_read(struct address_space *mapping,
}
cond_resched();
page_cache_readahead(mapping, ra, filp, index);
nr = nr - offset;
find_page:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment