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

Gui Jianfeng
2009-07-08T02:17:54+00:00

 
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 %lun", 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>
-diff  		if (iog->key) {
-			seq-printf(m, "%u %u %lun", MAJOR(iog->dev),
+			seq-printf(m, "%u:%u %lun", 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 %lun", MAJOR(iog->dev),
+			seq-printf(m, "%u:%u %lun", 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 %lun", MAJOR(iog->dev),
+			seq-printf(m, "%u:%u %lu %lun", 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 %lun", MAJOR(iog->dev),
+			seq-printf(m, "%u:%u %lun", MAJOR(iog->dev),
 					MINOR(iog->dev), iog->dequeue);
 		}
 	}


Loading


$ This page is proudly powered by www.pubbs.net, you can see more at kernel archive | Partners: ListWare Global Manufacturers