aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2010-08-23 06:25:03 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-23 06:25:03 -0400
commitc4e7893ebc3a5c507b53f59b9de448db20849944 (patch)
treebcb89e402cf8c36c33d70f04dc5fd434e1d58321 /block
parent80bdf0c78fff075dfa21576273c8b0c7db22bdfe (diff)
cfq-iosched: blktrace print per slice sector stats
o Divyesh had gotten rid of this code in the past. I want to re-introduce it back as it helps me a lot during debugging. Reviewed-by: Jeff Moyer <jmoyer@redhat.com> Reviewed-by: Divyesh Shah <dpshah@google.com> Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 85e48192754d..f65c6f01c475 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -148,6 +148,8 @@ struct cfq_queue {
148 struct cfq_queue *new_cfqq; 148 struct cfq_queue *new_cfqq;
149 struct cfq_group *cfqg; 149 struct cfq_group *cfqg;
150 struct cfq_group *orig_cfqg; 150 struct cfq_group *orig_cfqg;
151 /* Number of sectors dispatched from queue in single dispatch round */
152 unsigned long nr_sectors;
151}; 153};
152 154
153/* 155/*
@@ -960,8 +962,9 @@ static void cfq_group_served(struct cfq_data *cfqd, struct cfq_group *cfqg,
960 962
961 cfq_log_cfqg(cfqd, cfqg, "served: vt=%llu min_vt=%llu", cfqg->vdisktime, 963 cfq_log_cfqg(cfqd, cfqg, "served: vt=%llu min_vt=%llu", cfqg->vdisktime,
962 st->min_vdisktime); 964 st->min_vdisktime);
963 cfq_log_cfqq(cfqq->cfqd, cfqq, "sl_used=%u disp=%u charge=%u iops=%u", 965 cfq_log_cfqq(cfqq->cfqd, cfqq, "sl_used=%u disp=%u charge=%u iops=%u"
964 used_sl, cfqq->slice_dispatch, charge, iops_mode(cfqd)); 966 " sect=%u", used_sl, cfqq->slice_dispatch, charge,
967 iops_mode(cfqd), cfqq->nr_sectors);
965 cfq_blkiocg_update_timeslice_used(&cfqg->blkg, used_sl); 968 cfq_blkiocg_update_timeslice_used(&cfqg->blkg, used_sl);
966 cfq_blkiocg_set_start_empty_time(&cfqg->blkg); 969 cfq_blkiocg_set_start_empty_time(&cfqg->blkg);
967} 970}
@@ -1609,6 +1612,7 @@ static void __cfq_set_active_queue(struct cfq_data *cfqd,
1609 cfqq->allocated_slice = 0; 1612 cfqq->allocated_slice = 0;
1610 cfqq->slice_end = 0; 1613 cfqq->slice_end = 0;
1611 cfqq->slice_dispatch = 0; 1614 cfqq->slice_dispatch = 0;
1615 cfqq->nr_sectors = 0;
1612 1616
1613 cfq_clear_cfqq_wait_request(cfqq); 1617 cfq_clear_cfqq_wait_request(cfqq);
1614 cfq_clear_cfqq_must_dispatch(cfqq); 1618 cfq_clear_cfqq_must_dispatch(cfqq);
@@ -1971,6 +1975,7 @@ static void cfq_dispatch_insert(struct request_queue *q, struct request *rq)
1971 elv_dispatch_sort(q, rq); 1975 elv_dispatch_sort(q, rq);
1972 1976
1973 cfqd->rq_in_flight[cfq_cfqq_sync(cfqq)]++; 1977 cfqd->rq_in_flight[cfq_cfqq_sync(cfqq)]++;
1978 cfqq->nr_sectors += blk_rq_sectors(rq);
1974 cfq_blkiocg_update_dispatch_stats(&cfqq->cfqg->blkg, blk_rq_bytes(rq), 1979 cfq_blkiocg_update_dispatch_stats(&cfqq->cfqg->blkg, blk_rq_bytes(rq),
1975 rq_data_dir(rq), rq_is_sync(rq)); 1980 rq_data_dir(rq), rq_is_sync(rq));
1976} 1981}