aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
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 /include/linux/blkdev.h
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 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 6690e8bae7bb..f3fff8bf85ee 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -194,7 +194,10 @@ struct request {
194 194
195 struct gendisk *rq_disk; 195 struct gendisk *rq_disk;
196 unsigned long start_time; 196 unsigned long start_time;
197 197#ifdef CONFIG_BLK_CGROUP
198 unsigned long long start_time_ns;
199 unsigned long long io_start_time_ns; /* when passed to hardware */
200#endif
198 /* Number of scatter-gather DMA addr+len pairs after 201 /* Number of scatter-gather DMA addr+len pairs after
199 * physical address coalescing is performed. 202 * physical address coalescing is performed.
200 */ 203 */
@@ -1196,6 +1199,21 @@ static inline void put_dev_sector(Sector p)
1196struct work_struct; 1199struct work_struct;
1197int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); 1200int kblockd_schedule_work(struct request_queue *q, struct work_struct *work);
1198 1201
1202#ifdef CONFIG_BLK_CGROUP
1203static inline void set_start_time_ns(struct request *req)
1204{
1205 req->start_time_ns = sched_clock();
1206}
1207
1208static inline void set_io_start_time_ns(struct request *req)
1209{
1210 req->io_start_time_ns = sched_clock();
1211}
1212#else
1213static inline void set_start_time_ns(struct request *req) {}
1214static inline void set_io_start_time_ns(struct request *req) {}
1215#endif
1216
1199#define MODULE_ALIAS_BLOCKDEV(major,minor) \ 1217#define MODULE_ALIAS_BLOCKDEV(major,minor) \
1200 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) 1218 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
1201#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ 1219#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \