blkio: Add io controller stats like
Subsystems (3)
PATCH v2 1/1 blkio: Add io controller stats like
- io_service_time (the actual time in ns taken by the dis to service the IO)
- io_wait_time (the time spent waiting in the IO shceduler queues before getting serviced)
- io_serviced (number of IOs serviced from this blkio_group)
- io_service_bytes (Number of bytes served for this cgroup)
These stats are accumulated per operation type helping us to distinguish between read and write, and sync and async IO. This patch does not increment any of these stats.
Signed-off-by Divyesh Shah<[email protected]>
---
Documentation/cgroups/blkio-controller.txt | 33 +++++ block/blk-cgroup.c | 179 +++++++++++++++++++++++++--- block/blk-cgroup.h | 41 +++++- block/cfq-iosched.c | 2 4 files changed, 229 insertions(+), 26 deletions(-)
Documentation/cgroups/blkio-controller.txt +33 -0
@@ -75,6 +75,9 @@ CONFIG_DEBUG_BLK_CGROUP Details of cgroup files ======================= +Writing an int to any of the stats files (which excludes weight) will result +in all stats for that cgroup to be erased. + - blkio.weight - Specifies per cgroup weight.
@@ -92,6 +95,36 @@ Details of cgroup files third field specifies the number of sectors transferred by the group to/from the device. +- blkio.io_service_bytes + - Number of bytes transferred to/from the disk by the group. These + are further divided by the type of operation - read or write, sync + or async. First two fields specify the major and minor number of the + device, third field specifies the operation type and the fourth field + specifies the number of bytes. + +- blkio.io_serviced + - Number of IOs completed to/from the disk by the group. These + are further divided by the type of operation - read or write, sync + or async. First two fields specify the major and minor number of the + device, third field specifies the operation type and the fourth field + specifies the number of IOs. + +- blkio.io_service_time + - Total amount of time spent by the device to service the IOs for this + cgroup. This is in nanoseconds to make it meaningful for flash + devices too. This time is further divided by the type of operation - + read or write, sync or async. First two fields specify the major and + minor number of the device, third field specifies the operation type + and the fourth field specifies the io_service_time in ns. + +- blkio.io_wait_time + - Total amount of time the IO spent waiting in the scheduler queues for + service. This is in nanoseconds to make it meaningful for flash + devices too. This time is further divided by the type of operation - + read or write, sync or async. First two fields specify the major and + minor number of the device, third field specifies the operation type + and the fourth field specifies the io_wait_time in ns. + - blkio.dequeue - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. This gives the statistics about how many a times a group was dequeued
block/blk-cgroup.c +163 -16
236 lines not on this page · raw message
block/blk-cgroup.h +32 -9
74 lines not on this page · raw message
block/cfq-iosched.c +1 -1
@@ -914,7 +914,7 @@ static void cfq_group_served(struct cfq_data *cfqd, struct cfq_group *cfqg,cfq_log_cfqg (cfqd, cfqg,"served: vt=%llu min_vt=%llu" , cfqg->vdisktime, st->min_vdisktime); -blkiocg_update_blkio_group_stats (&cfqg->blkg, used_sl); +blkiocg_update_timeslice_used (&cfqg->blkg, used_sl); }#ifdef CONFIG_CFQ_GROUP_IOSCHED