diff options
author | Lee Susman <lsusman@codeaurora.org> | 2013-06-27 16:09:42 -0500 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-01-08 10:43:02 +0100 |
commit | 37527390652db2937cda6206f28e11ef34d92ada (patch) | |
tree | 0016122e0cf676e117be7f3f7794918578f6b76f | |
parent | aea0d63eed9227a15fcc48aa55da7f7027cf7f79 (diff) | |
download | kernel_samsung_tuna-37527390652db2937cda6206f28e11ef34d92ada.zip kernel_samsung_tuna-37527390652db2937cda6206f28e11ef34d92ada.tar.gz kernel_samsung_tuna-37527390652db2937cda6206f28e11ef34d92ada.tar.bz2 |
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>
Signed-off-by: Paul Reioux <reioux@gmail.com>
Conflicts:
include/linux/page-flags.h
Conflicts:
include/linux/page-flags.h
-rw-r--r-- | include/linux/page-flags.h | 1 | ||||
-rw-r--r-- | mm/page_alloc.c | 1 | ||||
-rw-r--r-- | mm/readahead.c | 3 |
3 files changed, 5 insertions, 0 deletions
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); |