diff options
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index b6491c020f26..f92ba2a869b4 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -532,6 +532,12 @@ static void cfq_add_rq_rb(struct request *rq) | |||
532 | 532 | ||
533 | if (!cfq_cfqq_on_rr(cfqq)) | 533 | if (!cfq_cfqq_on_rr(cfqq)) |
534 | cfq_add_cfqq_rr(cfqd, cfqq); | 534 | cfq_add_cfqq_rr(cfqd, cfqq); |
535 | |||
536 | /* | ||
537 | * check if this request is a better next-serve candidate | ||
538 | */ | ||
539 | cfqq->next_rq = cfq_choose_req(cfqd, cfqq->next_rq, rq); | ||
540 | BUG_ON(!cfqq->next_rq); | ||
535 | } | 541 | } |
536 | 542 | ||
537 | static inline void | 543 | static inline void |
@@ -986,9 +992,9 @@ __cfq_dispatch_requests(struct cfq_data *cfqd, struct cfq_queue *cfqq, | |||
986 | * expire an async queue immediately if it has used up its slice. idle | 992 | * expire an async queue immediately if it has used up its slice. idle |
987 | * queue always expire after 1 dispatch round. | 993 | * queue always expire after 1 dispatch round. |
988 | */ | 994 | */ |
989 | if ((!cfq_cfqq_sync(cfqq) && | 995 | if (cfqd->busy_queues > 1 && ((!cfq_cfqq_sync(cfqq) && |
990 | cfqd->dispatch_slice >= cfq_prio_to_maxrq(cfqd, cfqq)) || | 996 | cfqd->dispatch_slice >= cfq_prio_to_maxrq(cfqd, cfqq)) || |
991 | cfq_class_idle(cfqq)) { | 997 | cfq_class_idle(cfqq))) { |
992 | cfqq->slice_end = jiffies + 1; | 998 | cfqq->slice_end = jiffies + 1; |
993 | cfq_slice_expired(cfqd, 0, 0); | 999 | cfq_slice_expired(cfqd, 0, 0); |
994 | } | 1000 | } |
@@ -1051,19 +1057,21 @@ cfq_dispatch_requests(request_queue_t *q, int force) | |||
1051 | while ((cfqq = cfq_select_queue(cfqd)) != NULL) { | 1057 | while ((cfqq = cfq_select_queue(cfqd)) != NULL) { |
1052 | int max_dispatch; | 1058 | int max_dispatch; |
1053 | 1059 | ||
1054 | /* | 1060 | if (cfqd->busy_queues > 1) { |
1055 | * Don't repeat dispatch from the previous queue. | 1061 | /* |
1056 | */ | 1062 | * Don't repeat dispatch from the previous queue. |
1057 | if (prev_cfqq == cfqq) | 1063 | */ |
1058 | break; | 1064 | if (prev_cfqq == cfqq) |
1065 | break; | ||
1059 | 1066 | ||
1060 | /* | 1067 | /* |
1061 | * So we have dispatched before in this round, if the | 1068 | * So we have dispatched before in this round, if the |
1062 | * next queue has idling enabled (must be sync), don't | 1069 | * next queue has idling enabled (must be sync), don't |
1063 | * allow it service until the previous have continued. | 1070 | * allow it service until the previous have continued. |
1064 | */ | 1071 | */ |
1065 | if (cfqd->rq_in_driver && cfq_cfqq_idle_window(cfqq)) | 1072 | if (cfqd->rq_in_driver && cfq_cfqq_idle_window(cfqq)) |
1066 | break; | 1073 | break; |
1074 | } | ||
1067 | 1075 | ||
1068 | cfq_clear_cfqq_must_dispatch(cfqq); | 1076 | cfq_clear_cfqq_must_dispatch(cfqq); |
1069 | cfq_clear_cfqq_wait_request(cfqq); | 1077 | cfq_clear_cfqq_wait_request(cfqq); |
@@ -1370,7 +1378,9 @@ retry: | |||
1370 | atomic_set(&cfqq->ref, 0); | 1378 | atomic_set(&cfqq->ref, 0); |
1371 | cfqq->cfqd = cfqd; | 1379 | cfqq->cfqd = cfqd; |
1372 | 1380 | ||
1373 | cfq_mark_cfqq_idle_window(cfqq); | 1381 | if (key != CFQ_KEY_ASYNC) |
1382 | cfq_mark_cfqq_idle_window(cfqq); | ||
1383 | |||
1374 | cfq_mark_cfqq_prio_changed(cfqq); | 1384 | cfq_mark_cfqq_prio_changed(cfqq); |
1375 | cfq_mark_cfqq_queue_new(cfqq); | 1385 | cfq_mark_cfqq_queue_new(cfqq); |
1376 | cfq_init_prio_data(cfqq); | 1386 | cfq_init_prio_data(cfqq); |
@@ -1635,12 +1645,6 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq, | |||
1635 | cfqq->meta_pending++; | 1645 | cfqq->meta_pending++; |
1636 | 1646 | ||
1637 | /* | 1647 | /* |
1638 | * check if this request is a better next-serve candidate)) { | ||
1639 | */ | ||
1640 | cfqq->next_rq = cfq_choose_req(cfqd, cfqq->next_rq, rq); | ||
1641 | BUG_ON(!cfqq->next_rq); | ||
1642 | |||
1643 | /* | ||
1644 | * we never wait for an async request and we don't allow preemption | 1648 | * we never wait for an async request and we don't allow preemption |
1645 | * of an async request. so just return early | 1649 | * of an async request. so just return early |
1646 | */ | 1650 | */ |