aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorDivyesh Shah <dpshah@google.com>2010-04-13 13:59:17 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-04-13 13:59:17 -0400
commita11cdaa7af56423a921a8bdad8f5a5f4ddca918a (patch)
tree45309d760ab80347d4ad5a2cd249c988a507c636 /block/cfq-iosched.c
parentda69da184c06f365b335a0e013dc6360a82abe85 (diff)
block: Update to io-controller stats
Changelog from v1: o Call blkiocg_update_idle_time_stats() at cfq_rq_enqueued() instead of at dispatch time. Changelog from original patchset: (in response to Vivek Goyal's comments) o group blkiocg_update_blkio_group_dequeue_stats() with other DEBUG functions o rename blkiocg_update_set_active_queue_stats() to blkiocg_update_avg_queue_size_stats() o s/request/io/ in blkiocg_update_request_add_stats() and blkiocg_update_request_remove_stats() o Call cfq_del_timer() at request dispatch() instead of blkiocg_update_idle_time_stats() Signed-off-by: Divyesh Shah<dpshah@google.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 91af2f2e59ce..42be3b68d356 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1381,10 +1381,10 @@ static void cfq_reposition_rq_rb(struct cfq_queue *cfqq, struct request *rq)
1381{ 1381{
1382 elv_rb_del(&cfqq->sort_list, rq); 1382 elv_rb_del(&cfqq->sort_list, rq);
1383 cfqq->queued[rq_is_sync(rq)]--; 1383 cfqq->queued[rq_is_sync(rq)]--;
1384 blkiocg_update_request_remove_stats(&cfqq->cfqg->blkg, rq_data_dir(rq), 1384 blkiocg_update_io_remove_stats(&cfqq->cfqg->blkg, rq_data_dir(rq),
1385 rq_is_sync(rq)); 1385 rq_is_sync(rq));
1386 cfq_add_rq_rb(rq); 1386 cfq_add_rq_rb(rq);
1387 blkiocg_update_request_add_stats( 1387 blkiocg_update_io_add_stats(
1388 &cfqq->cfqg->blkg, &cfqq->cfqd->serving_group->blkg, 1388 &cfqq->cfqg->blkg, &cfqq->cfqd->serving_group->blkg,
1389 rq_data_dir(rq), rq_is_sync(rq)); 1389 rq_data_dir(rq), rq_is_sync(rq));
1390} 1390}
@@ -1442,7 +1442,7 @@ static void cfq_remove_request(struct request *rq)
1442 cfq_del_rq_rb(rq); 1442 cfq_del_rq_rb(rq);
1443 1443
1444 cfqq->cfqd->rq_queued--; 1444 cfqq->cfqd->rq_queued--;
1445 blkiocg_update_request_remove_stats(&cfqq->cfqg->blkg, rq_data_dir(rq), 1445 blkiocg_update_io_remove_stats(&cfqq->cfqg->blkg, rq_data_dir(rq),
1446 rq_is_sync(rq)); 1446 rq_is_sync(rq));
1447 if (rq_is_meta(rq)) { 1447 if (rq_is_meta(rq)) {
1448 WARN_ON(!cfqq->meta_pending); 1448 WARN_ON(!cfqq->meta_pending);
@@ -1541,7 +1541,7 @@ static void __cfq_set_active_queue(struct cfq_data *cfqd,
1541 if (cfqq) { 1541 if (cfqq) {
1542 cfq_log_cfqq(cfqd, cfqq, "set_active wl_prio:%d wl_type:%d", 1542 cfq_log_cfqq(cfqd, cfqq, "set_active wl_prio:%d wl_type:%d",
1543 cfqd->serving_prio, cfqd->serving_type); 1543 cfqd->serving_prio, cfqd->serving_type);
1544 blkiocg_update_set_active_queue_stats(&cfqq->cfqg->blkg); 1544 blkiocg_update_avg_queue_size_stats(&cfqq->cfqg->blkg);
1545 cfqq->slice_start = 0; 1545 cfqq->slice_start = 0;
1546 cfqq->dispatch_start = jiffies; 1546 cfqq->dispatch_start = jiffies;
1547 cfqq->allocated_slice = 0; 1547 cfqq->allocated_slice = 0;
@@ -2395,11 +2395,6 @@ static int cfq_dispatch_requests(struct request_queue *q, int force)
2395 } 2395 }
2396 2396
2397 cfq_log_cfqq(cfqd, cfqq, "dispatched a request"); 2397 cfq_log_cfqq(cfqd, cfqq, "dispatched a request");
2398 /*
2399 * This is needed since we don't exactly match the mod_timer() and
2400 * del_timer() calls in CFQ.
2401 */
2402 blkiocg_update_idle_time_stats(&cfqq->cfqg->blkg);
2403 return 1; 2398 return 1;
2404} 2399}
2405 2400
@@ -3208,8 +3203,11 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
3208 cfq_del_timer(cfqd, cfqq); 3203 cfq_del_timer(cfqd, cfqq);
3209 cfq_clear_cfqq_wait_request(cfqq); 3204 cfq_clear_cfqq_wait_request(cfqq);
3210 __blk_run_queue(cfqd->queue); 3205 __blk_run_queue(cfqd->queue);
3211 } else 3206 } else {
3207 blkiocg_update_idle_time_stats(
3208 &cfqq->cfqg->blkg);
3212 cfq_mark_cfqq_must_dispatch(cfqq); 3209 cfq_mark_cfqq_must_dispatch(cfqq);
3210 }
3213 } 3211 }
3214 } else if (cfq_should_preempt(cfqd, cfqq, rq)) { 3212 } else if (cfq_should_preempt(cfqd, cfqq, rq)) {
3215 /* 3213 /*
@@ -3235,7 +3233,7 @@ static void cfq_insert_request(struct request_queue *q, struct request *rq)
3235 list_add_tail(&rq->queuelist, &cfqq->fifo); 3233 list_add_tail(&rq->queuelist, &cfqq->fifo);
3236 cfq_add_rq_rb(rq); 3234 cfq_add_rq_rb(rq);
3237 3235
3238 blkiocg_update_request_add_stats(&cfqq->cfqg->blkg, 3236 blkiocg_update_io_add_stats(&cfqq->cfqg->blkg,
3239 &cfqd->serving_group->blkg, rq_data_dir(rq), 3237 &cfqd->serving_group->blkg, rq_data_dir(rq),
3240 rq_is_sync(rq)); 3238 rq_is_sync(rq));
3241 cfq_rq_enqueued(cfqd, cfqq, rq); 3239 cfq_rq_enqueued(cfqd, cfqq, rq);