aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorDivyesh Shah <dpshah@google.com>2010-04-01 18:01:41 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-04-02 02:44:37 -0400
commit9195291e5f05e01d67f9a09c756b8aca8f009089 (patch)
treee46a151fe39be2bc23d0683bedb2cbefe916fb5b /block/blk-core.c
parent303a3acb2362f16c7e7f4c53b40c2f4b396dc8d5 (diff)
blkio: Increment the blkio cgroup stats for real now
We also add start_time_ns and io_start_time_ns fields to struct request here to record the time when a request is created and when it is dispatched to device. We use ns uints here as ms and jiffies are not very useful for non-rotational media. Signed-off-by: Divyesh Shah<dpshah@google.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 9fe174dc74d1..1d94f15d7f0d 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -127,6 +127,7 @@ void blk_rq_init(struct request_queue *q, struct request *rq)
127 rq->tag = -1; 127 rq->tag = -1;
128 rq->ref_count = 1; 128 rq->ref_count = 1;
129 rq->start_time = jiffies; 129 rq->start_time = jiffies;
130 set_start_time_ns(rq);
130} 131}
131EXPORT_SYMBOL(blk_rq_init); 132EXPORT_SYMBOL(blk_rq_init);
132 133
@@ -1855,8 +1856,10 @@ void blk_dequeue_request(struct request *rq)
1855 * and to it is freed is accounted as io that is in progress at 1856 * and to it is freed is accounted as io that is in progress at
1856 * the driver side. 1857 * the driver side.
1857 */ 1858 */
1858 if (blk_account_rq(rq)) 1859 if (blk_account_rq(rq)) {
1859 q->in_flight[rq_is_sync(rq)]++; 1860 q->in_flight[rq_is_sync(rq)]++;
1861 set_io_start_time_ns(rq);
1862 }
1860} 1863}
1861 1864
1862/** 1865/**
@@ -2517,4 +2520,3 @@ int __init blk_dev_init(void)
2517 2520
2518 return 0; 2521 return 0;
2519} 2522}
2520