diff mbox

Re: [PATCH 11/25] io-controller: Export disk time used and nr sectors dipatched through cgroups

Message ID 4A54018C.5090804@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gui Jianfeng July 8, 2009, 2:16 a.m. UTC
Vivek Goyal wrote:
...
>  
> +static int io_cgroup_disk_time_read(struct cgroup *cgroup,
> +				struct cftype *cftype, struct seq_file *m)
> +{
> +	struct io_cgroup *iocg;
> +	struct io_group *iog;
> +	struct hlist_node *n;
> +
> +	if (!cgroup_lock_live_group(cgroup))
> +		return -ENODEV;
> +
> +	iocg = cgroup_to_io_cgroup(cgroup);
> +
> +	rcu_read_lock();
> +	hlist_for_each_entry_rcu(iog, n, &iocg->group_data, group_node) {
> +		/*
> +		 * There might be groups which are not functional and
> +		 * waiting to be reclaimed upon cgoup deletion.
> +		 */
> +		if (iog->key) {
> +			seq_printf(m, "%u %u %lu\n", MAJOR(iog->dev),
> +					MINOR(iog->dev),
> +					iog->entity.total_service);

Hi Vivek,

Let io.disk_*'s outputs conform with io.policy's.

Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
---
 block/elevator-fq.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Comments

Vivek Goyal July 8, 2009, 2 p.m. UTC | #1
On Wed, Jul 08, 2009 at 10:16:44AM +0800, Gui Jianfeng wrote:
[..]
> 
> Hi Vivek,
> 
> Let io.disk_*'s outputs conform with io.policy's.
> 

Sure. Queued up for next posting.

Thanks
Vivek

> Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
> ---
>  block/elevator-fq.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/block/elevator-fq.c b/block/elevator-fq.c
> index 7c83d1e..29392e7 100644
> --- a/block/elevator-fq.c
> +++ b/block/elevator-fq.c
> @@ -1631,7 +1631,7 @@ static int io_cgroup_disk_time_read(struct cgroup *cgroup,
>  		 * waiting to be reclaimed upon cgoup deletion.
>  		 */
>  		if (iog->key) {
> -			seq_printf(m, "%u %u %lu\n", MAJOR(iog->dev),
> +			seq_printf(m, "%u:%u %lu\n", MAJOR(iog->dev),
>  					MINOR(iog->dev),
>  					iog->entity.total_service);
>  		}
> @@ -1661,7 +1661,7 @@ static int io_cgroup_disk_sectors_read(struct cgroup *cgroup,
>  		 * waiting to be reclaimed upon cgoup deletion.
>  		 */
>  		if (iog->key) {
> -			seq_printf(m, "%u %u %lu\n", MAJOR(iog->dev),
> +			seq_printf(m, "%u:%u %lu\n", MAJOR(iog->dev),
>  					MINOR(iog->dev),
>  					iog->entity.total_sector_service);
>  		}
> @@ -1692,7 +1692,7 @@ static int io_cgroup_disk_queue_read(struct cgroup *cgroup,
>  		 * waiting to be reclaimed upon cgoup deletion.
>  		 */
>  		if (iog->key) {
> -			seq_printf(m, "%u %u %lu %lu\n", MAJOR(iog->dev),
> +			seq_printf(m, "%u:%u %lu %lu\n", MAJOR(iog->dev),
>  					MINOR(iog->dev), iog->queue,
>  					iog->queue_duration);
>  		}
> @@ -1722,7 +1722,7 @@ static int io_cgroup_disk_dequeue_read(struct cgroup *cgroup,
>  		 * waiting to be reclaimed upon cgoup deletion.
>  		 */
>  		if (iog->key) {
> -			seq_printf(m, "%u %u %lu\n", MAJOR(iog->dev),
> +			seq_printf(m, "%u:%u %lu\n", MAJOR(iog->dev),
>  					MINOR(iog->dev), iog->dequeue);
>  		}
>  	}
> -- 
> 1.5.4.rc3
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

diff --git a/block/elevator-fq.c b/block/elevator-fq.c
index 7c83d1e..29392e7 100644
--- a/block/elevator-fq.c
+++ b/block/elevator-fq.c
@@ -1631,7 +1631,7 @@  static int io_cgroup_disk_time_read(struct cgroup *cgroup,
 		 * waiting to be reclaimed upon cgoup deletion.
 		 */
 		if (iog->key) {
-			seq_printf(m, "%u %u %lu\n", MAJOR(iog->dev),
+			seq_printf(m, "%u:%u %lu\n", MAJOR(iog->dev),
 					MINOR(iog->dev),
 					iog->entity.total_service);
 		}
@@ -1661,7 +1661,7 @@  static int io_cgroup_disk_sectors_read(struct cgroup *cgroup,
 		 * waiting to be reclaimed upon cgoup deletion.
 		 */
 		if (iog->key) {
-			seq_printf(m, "%u %u %lu\n", MAJOR(iog->dev),
+			seq_printf(m, "%u:%u %lu\n", MAJOR(iog->dev),
 					MINOR(iog->dev),
 					iog->entity.total_sector_service);
 		}
@@ -1692,7 +1692,7 @@  static int io_cgroup_disk_queue_read(struct cgroup *cgroup,
 		 * waiting to be reclaimed upon cgoup deletion.
 		 */
 		if (iog->key) {
-			seq_printf(m, "%u %u %lu %lu\n", MAJOR(iog->dev),
+			seq_printf(m, "%u:%u %lu %lu\n", MAJOR(iog->dev),
 					MINOR(iog->dev), iog->queue,
 					iog->queue_duration);
 		}
@@ -1722,7 +1722,7 @@  static int io_cgroup_disk_dequeue_read(struct cgroup *cgroup,
 		 * waiting to be reclaimed upon cgoup deletion.
 		 */
 		if (iog->key) {
-			seq_printf(m, "%u %u %lu\n", MAJOR(iog->dev),
+			seq_printf(m, "%u:%u %lu\n", MAJOR(iog->dev),
 					MINOR(iog->dev), iog->dequeue);
 		}
 	}