On Mon, Apr 05, 2010 at 08:37:01PM -0700, Divyesh Shah wrote:> - io_service_time (the time between request dispatch and completion for IOs> in the cgroup)> - 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<dpshah@google.com>> ---> > Documentation/cgroups/blkio-controller.txt | 40 +++++++> block/blk-cgroup.c | 166 +++++++++++++++++++++++++---> block/blk-cgroup.h | 60 ++++++++--> block/cfq-iosched.c | 3 -> 4 files changed, 239 insertions(+), 30 deletions(-)> > diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt> index 630879c..087925b 100644> --- a/Documentation/cgroups/blkio-controller.txt> +++ b/Documentation/cgroups/blkio-controller.txt> @@ -77,7 +77,6 @@ Details of cgroup files> =======================> - blkio.weight> - Specifies per cgroup weight.> -> Currently allowed range of weights is from 100 to 1000.> > - blkio.time> @@ -92,6 +91,41 @@ 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.> +

Hi Divyesh,

V3 looks much better. Just couple of minor nits.

> +- blkio.io_service_time> + - Total amount of time between request dispatch and request completion> + for the IOs done by this cgroup. This is in nanoseconds to make it> + meaningful for flash devices too. For devices with queue depth of 1,> + this time represents the actual service time. When queue_depth > 1,> + that is no longer true as requests may be served out of order.

Like io_wait_time, can you also mention here that this time is cumulativetime and on NCQ disks it can be more than actual time elapsed.

I did a quick run with your patches. I ran a sequential workload for 30sin two groups of weight 100 and 200. Following is the output ofblkio.io_service_time (I have kept stats for only disk 253:3 in output).

This storage supports NCQ. We see that though I ran test only for30 seconds, total service ime for cgroup is close to 18+35=53 seconds.

> + 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 can be greater than the total time elapsed since it is> + cumulative io_wait_time for all IOs. 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> @@ -99,6 +133,10 @@ Details of cgroup files> and minor number of the device and third field specifies the number> of times a group was dequeued from a particular device.> > +- blkio.reset_stats> + - Writing an int to this file will result in resetting all the stats> + for that cgroup.> +

Personally, I like adding a separate file to reset the stats. Now one doesnot get surprised by the fact that writting to blkio.io_service_time, alsoreset rest of the stats.