Commit 2aa4a152 authored by Tejun Heo's avatar Tejun Heo

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: default avatarTejun Heo <tj@kernel.org>
parent aaec55a0
...@@ -58,14 +58,17 @@ enum stat_type { ...@@ -58,14 +58,17 @@ enum stat_type {
/* Per cpu stats */ /* Per cpu stats */
enum stat_type_cpu { enum stat_type_cpu {
BLKIO_STAT_CPU_SECTORS,
/* Total bytes transferred */ /* Total bytes transferred */
BLKIO_STAT_CPU_SERVICE_BYTES, BLKIO_STAT_CPU_SERVICE_BYTES,
/* Total IOs serviced, post merge */ /* Total IOs serviced, post merge */
BLKIO_STAT_CPU_SERVICED, BLKIO_STAT_CPU_SERVICED,
BLKIO_STAT_CPU_NR
/* All the single valued stats go below this */
BLKIO_STAT_CPU_SECTORS,
}; };
#define BLKIO_STAT_CPU_ARR_NR (BLKIO_STAT_CPU_SERVICED + 1)
enum stat_sub_type { enum stat_sub_type {
BLKIO_STAT_READ = 0, BLKIO_STAT_READ = 0,
BLKIO_STAT_WRITE, BLKIO_STAT_WRITE,
...@@ -167,7 +170,7 @@ struct blkio_group_stats { ...@@ -167,7 +170,7 @@ struct blkio_group_stats {
/* Per cpu blkio group stats */ /* Per cpu blkio group stats */
struct blkio_group_stats_cpu { struct blkio_group_stats_cpu {
uint64_t sectors; uint64_t sectors;
uint64_t stat_arr_cpu[BLKIO_STAT_CPU_NR][BLKIO_STAT_TOTAL]; uint64_t stat_arr_cpu[BLKIO_STAT_CPU_ARR_NR][BLKIO_STAT_TOTAL];
struct u64_stats_sync syncp; struct u64_stats_sync syncp;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment