* [PATCH] Expose the statistics in blkio.time and blkio.sectors for the root cgroup
@ 2010-03-24 23:35 Ricky Benitez
2010-03-25 0:52 ` Vivek Goyal
0 siblings, 1 reply; 4+ messages in thread
From: Ricky Benitez @ 2010-03-24 23:35 UTC (permalink / raw)
To: Jens Axboe, Vivek Goyal
Cc: Corrado Zoccolo, Jeff Moyer, Gui Jianfeng, linux-kernel,
Ricky Benitez
Currently, the io statistics for the root cgroup are maintained, but
they are not shown because the device information is not available at
the point that the root blkio cgroup is created. This patch updates
the device information when the statistics are updated so that the
statistics become visible.
Signed-off-by: Ricky Benitez <rickyb@google.com>
---
block/cfq-iosched.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index dee9d93..4a3579a 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -947,6 +947,11 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
unsigned int major, minor;
cfqg = cfqg_of_blkg(blkiocg_lookup_group(blkcg, key));
+ if (cfqg && !cfqg->blkg.dev && bdi->dev && dev_name(bdi->dev)) {
+ sscanf(dev_name(bdi->dev), "%u:%u", &major, &minor);
+ cfqg->blkg.dev = MKDEV(major, minor);
+ goto done;
+ }
if (cfqg || !create)
goto done;
--
1.7.0.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Expose the statistics in blkio.time and blkio.sectors for the root cgroup
2010-03-24 23:35 [PATCH] Expose the statistics in blkio.time and blkio.sectors for the root cgroup Ricky Benitez
@ 2010-03-25 0:52 ` Vivek Goyal
2010-04-05 14:20 ` Manuel Benitez
0 siblings, 1 reply; 4+ messages in thread
From: Vivek Goyal @ 2010-03-25 0:52 UTC (permalink / raw)
To: Ricky Benitez
Cc: Jens Axboe, Corrado Zoccolo, Jeff Moyer, Gui Jianfeng,
linux-kernel
On Wed, Mar 24, 2010 at 04:35:56PM -0700, Ricky Benitez wrote:
> Currently, the io statistics for the root cgroup are maintained, but
> they are not shown because the device information is not available at
> the point that the root blkio cgroup is created. This patch updates
> the device information when the statistics are updated so that the
> statistics become visible.
>
Ok, root group is created when request queue is being initialized and
device information like major/minor number is not available. This is
not the cleanest solution but can't think of something better right now.
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Thanks
Vivek
> Signed-off-by: Ricky Benitez <rickyb@google.com>
> ---
> block/cfq-iosched.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index dee9d93..4a3579a 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -947,6 +947,11 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
> unsigned int major, minor;
>
> cfqg = cfqg_of_blkg(blkiocg_lookup_group(blkcg, key));
> + if (cfqg && !cfqg->blkg.dev && bdi->dev && dev_name(bdi->dev)) {
> + sscanf(dev_name(bdi->dev), "%u:%u", &major, &minor);
> + cfqg->blkg.dev = MKDEV(major, minor);
> + goto done;
> + }
> if (cfqg || !create)
> goto done;
>
> --
> 1.7.0.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Expose the statistics in blkio.time and blkio.sectors for the root cgroup
2010-03-25 0:52 ` Vivek Goyal
@ 2010-04-05 14:20 ` Manuel Benitez
2010-04-05 16:20 ` Jens Axboe
0 siblings, 1 reply; 4+ messages in thread
From: Manuel Benitez @ 2010-04-05 14:20 UTC (permalink / raw)
To: Jens Axboe
Cc: Vivek Goyal, Corrado Zoccolo, Jeff Moyer, Gui Jianfeng,
linux-kernel
Jens,
Please let me know if this patch is/isn't acceptable. Not having the
statistics exposed at the root is a little bit problematic for our
user-level control programs.
-Ricky
On Wed, Mar 24, 2010 at 5:52 PM, Vivek Goyal <vgoyal@redhat.com> wrote:
> On Wed, Mar 24, 2010 at 04:35:56PM -0700, Ricky Benitez wrote:
>> Currently, the io statistics for the root cgroup are maintained, but
>> they are not shown because the device information is not available at
>> the point that the root blkio cgroup is created. This patch updates
>> the device information when the statistics are updated so that the
>> statistics become visible.
>>
>
> Ok, root group is created when request queue is being initialized and
> device information like major/minor number is not available. This is
> not the cleanest solution but can't think of something better right now.
>
> Acked-by: Vivek Goyal <vgoyal@redhat.com>
>
> Thanks
> Vivek
>
>> Signed-off-by: Ricky Benitez <rickyb@google.com>
>> ---
>> block/cfq-iosched.c | 5 +++++
>> 1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
>> index dee9d93..4a3579a 100644
>> --- a/block/cfq-iosched.c
>> +++ b/block/cfq-iosched.c
>> @@ -947,6 +947,11 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
>> unsigned int major, minor;
>>
>> cfqg = cfqg_of_blkg(blkiocg_lookup_group(blkcg, key));
>> + if (cfqg && !cfqg->blkg.dev && bdi->dev && dev_name(bdi->dev)) {
>> + sscanf(dev_name(bdi->dev), "%u:%u", &major, &minor);
>> + cfqg->blkg.dev = MKDEV(major, minor);
>> + goto done;
>> + }
>> if (cfqg || !create)
>> goto done;
>>
>> --
>> 1.7.0.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Expose the statistics in blkio.time and blkio.sectors for the root cgroup
2010-04-05 14:20 ` Manuel Benitez
@ 2010-04-05 16:20 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2010-04-05 16:20 UTC (permalink / raw)
To: Manuel Benitez
Cc: Vivek Goyal, Corrado Zoccolo, Jeff Moyer, Gui Jianfeng,
linux-kernel
On Mon, Apr 05 2010, Manuel Benitez wrote:
> Jens,
>
> Please let me know if this patch is/isn't acceptable. Not having the
> statistics exposed at the root is a little bit problematic for our
> user-level control programs.
It's fine with me, I'll queue it up.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-04-05 16:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 23:35 [PATCH] Expose the statistics in blkio.time and blkio.sectors for the root cgroup Ricky Benitez
2010-03-25 0:52 ` Vivek Goyal
2010-04-05 14:20 ` Manuel Benitez
2010-04-05 16:20 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox