Commit c4e7893ebc3a5c507b53f59b9de448db20849944

Authored by Vivek Goyal
Committed by Jens Axboe
1 parent 80bdf0c78f

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>

Showing 1 changed file with 7 additions and 2 deletions Side-by-side Diff

... ... @@ -148,6 +148,8 @@
148 148 struct cfq_queue *new_cfqq;
149 149 struct cfq_group *cfqg;
150 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 @@
960 962  
961 963 cfq_log_cfqg(cfqd, cfqg, "served: vt=%llu min_vt=%llu", cfqg->vdisktime,
962 964 st->min_vdisktime);
963   - 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));
  965 + cfq_log_cfqq(cfqq->cfqd, cfqq, "sl_used=%u disp=%u charge=%u iops=%u"
  966 + " sect=%u", used_sl, cfqq->slice_dispatch, charge,
  967 + iops_mode(cfqd), cfqq->nr_sectors);
965 968 cfq_blkiocg_update_timeslice_used(&cfqg->blkg, used_sl);
966 969 cfq_blkiocg_set_start_empty_time(&cfqg->blkg);
967 970 }
... ... @@ -1609,6 +1612,7 @@
1609 1612 cfqq->allocated_slice = 0;
1610 1613 cfqq->slice_end = 0;
1611 1614 cfqq->slice_dispatch = 0;
  1615 + cfqq->nr_sectors = 0;
1612 1616  
1613 1617 cfq_clear_cfqq_wait_request(cfqq);
1614 1618 cfq_clear_cfqq_must_dispatch(cfqq);
... ... @@ -1971,6 +1975,7 @@
1971 1975 elv_dispatch_sort(q, rq);
1972 1976  
1973 1977 cfqd->rq_in_flight[cfq_cfqq_sync(cfqq)]++;
  1978 + cfqq->nr_sectors += blk_rq_sectors(rq);
1974 1979 cfq_blkiocg_update_dispatch_stats(&cfqq->cfqg->blkg, blk_rq_bytes(rq),
1975 1980 rq_data_dir(rq), rq_is_sync(rq));
1976 1981 }