Commit dfb3d72a authored by Aaron Carroll's avatar Aaron Carroll Committed by Jens Axboe

Deadline iosched: Reset batch for ordered requests

The deadline I/O scheduler does not reset the batch count when starting
a new batch at a higher-sectored request.  This means the second and
subsequent batch in the same data direction will never exceed a single
request in size whenever higher-sectored requests are pending.

This patch gives new batches in the same data direction as old ones
their full quota of requests by resetting the batch count.
Signed-off-by: default avatarAaron Carroll <aaronc@gelato.unsw.edu.au>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 5d1a5366
......@@ -306,12 +306,11 @@ static int deadline_dispatch_requests(struct request_queue *q, int force)
dispatch_find_request:
/*
* we are not running a batch, find best request for selected data_dir
* and start a new batch
*/
if (deadline_check_fifo(dd, data_dir)) {
/* An expired request exists - satisfy it */
dd->batching = 0;
rq = rq_entry_fifo(dd->fifo_list[data_dir].next);
} else if (dd->next_rq[data_dir]) {
/*
* The last req was the same dir and we have a next request in
......@@ -325,12 +324,13 @@ static int deadline_dispatch_requests(struct request_queue *q, int force)
* higher-sectored requests. Go back to the lowest sectored
* request (1 way elevator) and start a new batch.
*/
dd->batching = 0;
node = rb_first(&dd->sort_list[data_dir]);
if (node)
rq = rb_entry_rq(node);
}
dd->batching = 0;
dispatch_request:
/*
* rq is the selected appropriate request.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment