diff options
author | Divyesh Shah <dpshah@google.com> | 2010-04-09 00:14:23 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-04-09 02:36:07 -0400 |
commit | 812d402648f4fc1ab1091b2172a46fc1b367c724 (patch) | |
tree | 9dc52d5bfdbc170559169a0157ed3295d551e9cf /block/blk-cgroup.h | |
parent | 84c124da9ff50bd71fab9c939ee5b7cd8bef2bd9 (diff) |
blkio: Add io_merged stat
This includes both the number of bios merged into requests belonging to this
cgroup as well as the number of requests merged together.
In the past, we've observed different merging behavior across upstream kernels,
some by design some actual bugs. This stat helps a lot in debugging such
problems when applications report decreased throughput with a new kernel
version.
This needed adding an extra elevator function to capture bios being merged as I
did not want to pollute elevator code with blkiocg knowledge and hence needed
the accounting invocation to come from CFQ.
Signed-off-by: Divyesh Shah<dpshah@google.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r-- | block/blk-cgroup.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index b22e55390a4f..470a29db6bec 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -34,6 +34,8 @@ enum stat_type { | |||
34 | BLKIO_STAT_SERVICED, | 34 | BLKIO_STAT_SERVICED, |
35 | /* Total time spent waiting in scheduler queue in ns */ | 35 | /* Total time spent waiting in scheduler queue in ns */ |
36 | BLKIO_STAT_WAIT_TIME, | 36 | BLKIO_STAT_WAIT_TIME, |
37 | /* Number of IOs merged */ | ||
38 | BLKIO_STAT_MERGED, | ||
37 | /* All the single valued stats go below this */ | 39 | /* All the single valued stats go below this */ |
38 | BLKIO_STAT_TIME, | 40 | BLKIO_STAT_TIME, |
39 | BLKIO_STAT_SECTORS, | 41 | BLKIO_STAT_SECTORS, |
@@ -61,7 +63,7 @@ struct blkio_group_stats { | |||
61 | /* total disk time and nr sectors dispatched by this group */ | 63 | /* total disk time and nr sectors dispatched by this group */ |
62 | uint64_t time; | 64 | uint64_t time; |
63 | uint64_t sectors; | 65 | uint64_t sectors; |
64 | uint64_t stat_arr[BLKIO_STAT_WAIT_TIME + 1][BLKIO_STAT_TOTAL]; | 66 | uint64_t stat_arr[BLKIO_STAT_MERGED + 1][BLKIO_STAT_TOTAL]; |
65 | #ifdef CONFIG_DEBUG_BLK_CGROUP | 67 | #ifdef CONFIG_DEBUG_BLK_CGROUP |
66 | /* How many times this group has been removed from service tree */ | 68 | /* How many times this group has been removed from service tree */ |
67 | unsigned long dequeue; | 69 | unsigned long dequeue; |
@@ -148,6 +150,8 @@ void blkiocg_update_dispatch_stats(struct blkio_group *blkg, uint64_t bytes, | |||
148 | bool direction, bool sync); | 150 | bool direction, bool sync); |
149 | void blkiocg_update_completion_stats(struct blkio_group *blkg, | 151 | void blkiocg_update_completion_stats(struct blkio_group *blkg, |
150 | uint64_t start_time, uint64_t io_start_time, bool direction, bool sync); | 152 | uint64_t start_time, uint64_t io_start_time, bool direction, bool sync); |
153 | void blkiocg_update_io_merged_stats(struct blkio_group *blkg, bool direction, | ||
154 | bool sync); | ||
151 | #else | 155 | #else |
152 | struct cgroup; | 156 | struct cgroup; |
153 | static inline struct blkio_cgroup * | 157 | static inline struct blkio_cgroup * |
@@ -169,5 +173,7 @@ static inline void blkiocg_update_dispatch_stats(struct blkio_group *blkg, | |||
169 | static inline void blkiocg_update_completion_stats(struct blkio_group *blkg, | 173 | static inline void blkiocg_update_completion_stats(struct blkio_group *blkg, |
170 | uint64_t start_time, uint64_t io_start_time, bool direction, | 174 | uint64_t start_time, uint64_t io_start_time, bool direction, |
171 | bool sync) {} | 175 | bool sync) {} |
176 | static inline void blkiocg_update_io_merged_stats(struct blkio_group *blkg, | ||
177 | bool direction, bool sync) {} | ||
172 | #endif | 178 | #endif |
173 | #endif /* _BLK_CGROUP_H */ | 179 | #endif /* _BLK_CGROUP_H */ |