mm: pass readahead info down to the i/o scheduler

Some i/o schedulers (i.e. row-iosched, cfq-iosched) deploy an idling
algorithm in order to be better synced with the readahead algorithm.
Idling is a prediction algorithm for incoming read requests.

In this patch we mark pages which are part of a readahead window, by
setting a newly introduced flag. With this flag, the i/o scheduler can
identify a request which is associated with a readahead page. This
enables the i/o scheduler's idling mechanism to be en-sync with the
readahead mechanism and, in turn, can increase read throughput.

Change-Id: I0654f23315b6d19d71bcc9cc029c6b281a44b196
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
This commit is contained in:
Lee Susman 2013-05-05 17:31:17 +03:00 committed by Stephen Boyd
parent b02da723ff
commit a4fe692df6
3 changed files with 5 additions and 0 deletions

View file

@ -109,6 +109,7 @@ enum pageflags {
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
PG_compound_lock,
#endif
PG_readahead, /* page in a readahead window */
__NR_PAGEFLAGS,
/* Filesystems */

View file

@ -6267,6 +6267,7 @@ static const struct trace_print_flags pageflag_names[] = {
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
{1UL << PG_compound_lock, "compound_lock" },
#endif
{1UL << PG_readahead, "PG_readahead" },
};
static void dump_page_flags(unsigned long flags)

View file

@ -186,6 +186,9 @@ __do_page_cache_readahead(struct address_space *mapping, struct file *filp,
if (!page)
break;
page->index = page_offset;
page->flags |= (1L << PG_readahead);
list_add(&page->lru, &page_pool);
if (page_idx == nr_to_read - lookahead_size)
SetPageReadahead(page);