From b01efec403768e5dedaeaf4921a8aca486fc3ef0 Mon Sep 17 00:00:00 2001 From: Aaron Carroll Date: Tue, 30 Oct 2007 10:40:13 +0100 Subject: [PATCH] --- yaml --- r: 73103 b: refs/heads/master c: 6f5d8aa6382eef2b26032c88656270bdae7f0c42 h: refs/heads/master i: 73101: 76f9d500954aedeab0373c92994b49abb446a2b7 73099: 282589b492e59338e38f3963d57023f6ce00102f 73095: 08a2af1a17b6491d7eb9867e490708bd3194920a 73087: 220d070f18ea1450ce7b33a9394bcb25f8442b2e v: v3 --- [refs] | 2 +- trunk/block/deadline-iosched.c | 21 +++++++-------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index 22b804d95056..172338226a9c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: dfb3d72a9aa519672c9ae06f0d2f93eccb35482f +refs/heads/master: 6f5d8aa6382eef2b26032c88656270bdae7f0c42 diff --git a/trunk/block/deadline-iosched.c b/trunk/block/deadline-iosched.c index cb94c838087a..a054eef8dff6 100644 --- a/trunk/block/deadline-iosched.c +++ b/trunk/block/deadline-iosched.c @@ -306,27 +306,20 @@ 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 */ + if (deadline_check_fifo(dd, data_dir) || !dd->next_rq[data_dir]) { + /* + * A deadline has expired, the last request was in the other + * direction, or we have run out of higher-sectored requests. + * Start again from the request with the earliest expiry time. + */ rq = rq_entry_fifo(dd->fifo_list[data_dir].next); - } else if (dd->next_rq[data_dir]) { + } else { /* * The last req was the same dir and we have a next request in * sort order. No expired requests so continue on from here. */ rq = dd->next_rq[data_dir]; - } else { - struct rb_node *node; - /* - * The last req was the other direction or we have run out of - * higher-sectored requests. Go back to the lowest sectored - * request (1 way elevator) and start a new batch. - */ - node = rb_first(&dd->sort_list[data_dir]); - if (node) - rq = rb_entry_rq(node); } dd->batching = 0;