Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4fe692d authored by Lee Susman's avatar Lee Susman Committed by Stephen Boyd
Browse files

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: default avatarLee Susman <lsusman@codeaurora.org>
parent b02da723
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ enum pageflags {
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
	PG_compound_lock,
#endif
	PG_readahead,		/* page in a readahead window */
	__NR_PAGEFLAGS,

	/* Filesystems */
+1 −0
Original line number Diff line number Diff line
@@ -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)
+3 −0
Original line number Diff line number Diff line
@@ -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);