mirror of
https://github.com/joel16/android_kernel_sony_msm8994_rework.git
synced 2024-11-23 11:59:58 +00:00
block: row-iosched idling triggered by readahead pages
In the current implementation idling is triggered only by request insertion frequency. This heuristic is not very accurate and may hit random requests that shouldn't trigger idling. This patch uses the PG_readahead flag in struct page's flags, which indicates that the page is part of a readahead window, to start idling upon dispatch of a request associated with a readahead page. The above readehead flag is used together with the existing insertion-frequency trigger. The frequency timer will catch read requests which are not part of a readahead window, but are still part of a sequential stream (and therefore dispatched in small time intervals). Change-Id: Icb7145199c007408de3f267645ccb842e051fd00 Signed-off-by: Lee Susman <lsusman@codeaurora.org>
This commit is contained in:
parent
a4fe692df6
commit
80a8f0f87b
@ -97,7 +97,7 @@ static const struct row_queue_params row_queues_def[] = {
|
||||
|
||||
/* Default values for idling on read queues (in msec) */
|
||||
#define ROW_IDLE_TIME_MSEC 5
|
||||
#define ROW_READ_FREQ_MSEC 20
|
||||
#define ROW_READ_FREQ_MSEC 5
|
||||
|
||||
/**
|
||||
* struct rowq_idling_data - parameters for idling on the queue
|
||||
@ -331,6 +331,10 @@ static void row_add_request(struct request_queue *q,
|
||||
struct row_queue *rqueue = RQ_ROWQ(rq);
|
||||
s64 diff_ms;
|
||||
bool queue_was_empty = list_empty(&rqueue->fifo);
|
||||
unsigned long bv_page_flags = 0;
|
||||
|
||||
if (rq->bio && rq->bio->bi_io_vec && rq->bio->bi_io_vec->bv_page)
|
||||
bv_page_flags = rq->bio->bi_io_vec->bv_page->flags;
|
||||
|
||||
list_add_tail(&rq->queuelist, &rqueue->fifo);
|
||||
rd->nr_reqs[rq_data_dir(rq)]++;
|
||||
@ -360,7 +364,9 @@ static void row_add_request(struct request_queue *q,
|
||||
rqueue->idle_data.begin_idling = false;
|
||||
return;
|
||||
}
|
||||
if (diff_ms < rd->rd_idle_data.freq_ms) {
|
||||
|
||||
if ((bv_page_flags & (1L << PG_readahead)) ||
|
||||
(diff_ms < rd->rd_idle_data.freq_ms)) {
|
||||
rqueue->idle_data.begin_idling = true;
|
||||
row_log_rowq(rd, rqueue->prio, "Enable idling");
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user