diff options
author | Divyesh Shah <dpshah@google.com> | 2010-04-01 18:01:41 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-04-02 02:44:37 -0400 |
commit | 9195291e5f05e01d67f9a09c756b8aca8f009089 (patch) | |
tree | e46a151fe39be2bc23d0683bedb2cbefe916fb5b /include/linux/blkdev.h | |
parent | 303a3acb2362f16c7e7f4c53b40c2f4b396dc8d5 (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.h | 20 |
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) | |||
1196 | struct work_struct; | 1199 | struct work_struct; |
1197 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); | 1200 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); |
1198 | 1201 | ||
1202 | #ifdef CONFIG_BLK_CGROUP | ||
1203 | static inline void set_start_time_ns(struct request *req) | ||
1204 | { | ||
1205 | req->start_time_ns = sched_clock(); | ||
1206 | } | ||
1207 | |||
1208 | static inline void set_io_start_time_ns(struct request *req) | ||
1209 | { | ||
1210 | req->io_start_time_ns = sched_clock(); | ||
1211 | } | ||
1212 | #else | ||
1213 | static inline void set_start_time_ns(struct request *req) {} | ||
1214 | static 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) \ |