From 37527390652db2937cda6206f28e11ef34d92ada Mon Sep 17 00:00:00 2001 From: Lee Susman Date: Thu, 27 Jun 2013 16:09:42 -0500 Subject: 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 Signed-off-by: Paul Reioux Conflicts: include/linux/page-flags.h Conflicts: include/linux/page-flags.h --- include/linux/page-flags.h | 1 + mm/page_alloc.c | 1 + mm/readahead.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index ebd8640..40edce1 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -113,6 +113,7 @@ enum pageflags { #ifdef CONFIG_CLEANCACHE PG_was_active, #endif + PG_readahead, /* page in a readahead window */ __NR_PAGEFLAGS, /* Filesystems */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 470993a..4410edd 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5846,6 +5846,7 @@ static struct trace_print_flags pageflag_names[] = { #ifdef CONFIG_MEMORY_FAILURE {1UL << PG_hwpoison, "hwpoison" }, #endif + {1UL << PG_readahead, "PG_readahead" }, {-1UL, NULL }, }; diff --git a/mm/readahead.c b/mm/readahead.c index df60df9..4df6dc7 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -210,6 +210,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); -- cgit v1.1