diff options
author | Tejun Heo <tj@kernel.org> | 2012-04-01 17:38:42 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-04-01 17:38:42 -0400 |
commit | 2aa4a1523b40a065bc3a31e20097ea7a618ec3de (patch) | |
tree | b4fb9e7e593d539f70c61c2d7b39b0028edf08eb /block/blk-cgroup.h | |
parent | aaec55a002a29bf940588dc03253099a4cd543bf (diff) |
blkcg: BLKIO_STAT_CPU_SECTORS doesn't have subcounters
BLKIO_STAT_CPU_SECTORS doesn't need read/write/sync/async subcounters
and is counted by blkio_group_stats_cpu->sectors; however, it still
holds a member in blkio_group_stats_cpu->stat_arr_cpu.
Rearrange stat_type_cpu and define BLKIO_STAT_CPU_ARR_NR and use it
for stat_arr_cpu[] size so that only SERVICE_BYTES and SERVICED have
subcounters.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r-- | block/blk-cgroup.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 1add3dcfc19d..2060d812ae8e 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -58,14 +58,17 @@ enum stat_type { | |||
58 | 58 | ||
59 | /* Per cpu stats */ | 59 | /* Per cpu stats */ |
60 | enum stat_type_cpu { | 60 | enum stat_type_cpu { |
61 | BLKIO_STAT_CPU_SECTORS, | ||
62 | /* Total bytes transferred */ | 61 | /* Total bytes transferred */ |
63 | BLKIO_STAT_CPU_SERVICE_BYTES, | 62 | BLKIO_STAT_CPU_SERVICE_BYTES, |
64 | /* Total IOs serviced, post merge */ | 63 | /* Total IOs serviced, post merge */ |
65 | BLKIO_STAT_CPU_SERVICED, | 64 | BLKIO_STAT_CPU_SERVICED, |
66 | BLKIO_STAT_CPU_NR | 65 | |
66 | /* All the single valued stats go below this */ | ||
67 | BLKIO_STAT_CPU_SECTORS, | ||
67 | }; | 68 | }; |
68 | 69 | ||
70 | #define BLKIO_STAT_CPU_ARR_NR (BLKIO_STAT_CPU_SERVICED + 1) | ||
71 | |||
69 | enum stat_sub_type { | 72 | enum stat_sub_type { |
70 | BLKIO_STAT_READ = 0, | 73 | BLKIO_STAT_READ = 0, |
71 | BLKIO_STAT_WRITE, | 74 | BLKIO_STAT_WRITE, |
@@ -167,7 +170,7 @@ struct blkio_group_stats { | |||
167 | /* Per cpu blkio group stats */ | 170 | /* Per cpu blkio group stats */ |
168 | struct blkio_group_stats_cpu { | 171 | struct blkio_group_stats_cpu { |
169 | uint64_t sectors; | 172 | uint64_t sectors; |
170 | uint64_t stat_arr_cpu[BLKIO_STAT_CPU_NR][BLKIO_STAT_TOTAL]; | 173 | uint64_t stat_arr_cpu[BLKIO_STAT_CPU_ARR_NR][BLKIO_STAT_TOTAL]; |
171 | struct u64_stats_sync syncp; | 174 | struct u64_stats_sync syncp; |
172 | }; | 175 | }; |
173 | 176 | ||