aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-02-05 05:55:35 -0500
committerJens Axboe <axboe@carl.home.kernel.dk>2007-02-11 17:14:44 -0500
commit98e41c7dfc90c0e9a1086502d4c4d367e1ad74db (patch)
treec064f21aec474eb76de222175f042035640de290 /block
parentaaf1228ddfb44f04c87d1e7dfc5ccffdba74363d (diff)
[PATCH] cfq-iosched: move on_rr check into cfq_resort_rr_list()
Move the on_rr check into cfq_resort_rr_list(), every call site needs to check it anyway. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index a31066d6c20c..4c24986151ba 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -357,7 +357,11 @@ static void cfq_resort_rr_list(struct cfq_queue *cfqq, int preempted)
357 struct cfq_data *cfqd = cfqq->cfqd; 357 struct cfq_data *cfqd = cfqq->cfqd;
358 struct list_head *list; 358 struct list_head *list;
359 359
360 BUG_ON(!cfq_cfqq_on_rr(cfqq)); 360 /*
361 * Resorting requires the cfqq to be on the RR list already.
362 */
363 if (!cfq_cfqq_on_rr(cfqq))
364 return;
361 365
362 list_del(&cfqq->cfq_list); 366 list_del(&cfqq->cfq_list);
363 367
@@ -642,8 +646,7 @@ __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq,
642 else 646 else
643 cfqq->slice_left = 0; 647 cfqq->slice_left = 0;
644 648
645 if (cfq_cfqq_on_rr(cfqq)) 649 cfq_resort_rr_list(cfqq, preempted);
646 cfq_resort_rr_list(cfqq, preempted);
647 650
648 if (cfqq == cfqd->active_queue) 651 if (cfqq == cfqd->active_queue)
649 cfqd->active_queue = NULL; 652 cfqd->active_queue = NULL;
@@ -1238,9 +1241,7 @@ static void cfq_init_prio_data(struct cfq_queue *cfqq)
1238 cfqq->org_ioprio = cfqq->ioprio; 1241 cfqq->org_ioprio = cfqq->ioprio;
1239 cfqq->org_ioprio_class = cfqq->ioprio_class; 1242 cfqq->org_ioprio_class = cfqq->ioprio_class;
1240 1243
1241 if (cfq_cfqq_on_rr(cfqq)) 1244 cfq_resort_rr_list(cfqq, 0);
1242 cfq_resort_rr_list(cfqq, 0);
1243
1244 cfq_clear_cfqq_prio_changed(cfqq); 1245 cfq_clear_cfqq_prio_changed(cfqq);
1245} 1246}
1246 1247
@@ -1691,8 +1692,7 @@ static void cfq_completed_request(request_queue_t *q, struct request *rq)
1691 if (!cfq_class_idle(cfqq)) 1692 if (!cfq_class_idle(cfqq))
1692 cfqd->last_end_request = now; 1693 cfqd->last_end_request = now;
1693 1694
1694 if (!cfq_cfqq_dispatched(cfqq) && cfq_cfqq_on_rr(cfqq)) 1695 cfq_resort_rr_list(cfqq, 0);
1695 cfq_resort_rr_list(cfqq, 0);
1696 1696
1697 if (sync) 1697 if (sync)
1698 RQ_CIC(rq)->last_end_request = now; 1698 RQ_CIC(rq)->last_end_request = now;
@@ -1742,8 +1742,7 @@ static void cfq_prio_boost(struct cfq_queue *cfqq)
1742 /* 1742 /*
1743 * refile between round-robin lists if we moved the priority class 1743 * refile between round-robin lists if we moved the priority class
1744 */ 1744 */
1745 if ((ioprio_class != cfqq->ioprio_class || ioprio != cfqq->ioprio) && 1745 if ((ioprio_class != cfqq->ioprio_class || ioprio != cfqq->ioprio))
1746 cfq_cfqq_on_rr(cfqq))
1747 cfq_resort_rr_list(cfqq, 0); 1746 cfq_resort_rr_list(cfqq, 0);
1748} 1747}
1749 1748