From: Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Anatol Pomozov
<anatol.pomozov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jens Axboe <axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
Subject: Re: [PATCH] cgroups: Do not show inactive devices in cgroups statistics
Date: Wed, 26 Jun 2013 17:08:20 -0400 [thread overview]
Message-ID: <20130626210820.GA17564@redhat.com> (raw)
In-Reply-To: <20130626204540.GA4536-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
On Wed, Jun 26, 2013 at 01:45:40PM -0700, Tejun Heo wrote:
> (cc'ing Vivek and Jens)
>
> On Wed, Jun 26, 2013 at 12:26:10PM -0700, Anatol Pomozov wrote:
> > @@ -548,6 +548,9 @@ u64 __blkg_prfill_u64(struct seq_file *sf, struct blkg_policy_data *pd, u64 v)
> > if (!dname)
> > return 0;
> >
> > + if (!v)
> > + return 0;
> > +
>
> I don't think it'd be a good idea to filter out 0 by default from
> __blkg_prfill_u64(). It'd probably be a better idea to do the
> filtering from the users of __blkg_prfill_u64(). Would that be a lot
> more churn?
>
> > @@ -571,19 +574,23 @@ u64 __blkg_prfill_rwstat(struct seq_file *sf, struct blkg_policy_data *pd,
> > [BLKG_RWSTAT_ASYNC] = "Async",
> > };
> > const char *dname = blkg_dev_name(pd->blkg);
> > - u64 v;
> > + u64 total;
> > int i;
> >
> > if (!dname)
> > return 0;
> >
> > + total = rwstat->cnt[BLKG_RWSTAT_READ] + rwstat->cnt[BLKG_RWSTAT_WRITE];
> > + /* skip devices with no activity */
> > + if (!total)
> > + return 0;
> > +
>
> Doing it from rwstat is fine as it's always printing "stats" and
> suppressing 0 stats by default should be fine, I think. Can you
> please update the function comment accordingly tho?
>
> Vivek, any objections?
I don't have an objection to not listing stats of devices which are
zero, but wondering why all the devices of system are showing in
cgroup stat.
Don't we add a blkg to a blkcg only if that cgroup did some IO to
that particular device. If yes, then only those devices should
show to which cgroup did some IO and that should be non-zero.
Is it because of hierarchical support where if a child does IO
to device, we will add an blkg instance to parent's cgroup? In
that case hierarchical stats will still be non-zero but group
local stat can be zero.
I think it makes sense to remove zero stats. Hierarchical stat
will anyway have that data.
Thanks
Vivek
next prev parent reply other threads:[~2013-06-26 21:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-26 19:26 [PATCH] cgroups: Do not show inactive devices in cgroups statistics Anatol Pomozov
[not found] ` <1372274770-30679-1-git-send-email-anatol.pomozov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-06-26 19:36 ` Anatol Pomozov
2013-06-26 20:45 ` Tejun Heo
[not found] ` <20130626204540.GA4536-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-06-26 21:08 ` Vivek Goyal [this message]
[not found] ` <20130626210820.GA17564-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-06-26 21:11 ` Tejun Heo
[not found] ` <CAOS58YP_Umud2DTY+3tc4m02FywGNOEALSN1An4OLXczcmsQ4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-27 0:37 ` Anatol Pomozov
[not found] ` <CAOMFOmVqevNSKgWR5keT8u7vsCRpHhYROejM6OucyNeeA6j6zQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-27 1:23 ` Tejun Heo
[not found] ` <20130627012304.GG4536-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-06-27 1:23 ` Tejun Heo
2013-06-27 16:37 ` Anatol Pomozov
[not found] ` <1372351046-11976-1-git-send-email-anatol.pomozov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-06-27 16:59 ` Tejun Heo
[not found] ` <20130627165943.GA5599-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-06-27 17:21 ` Anatol Pomozov
2013-06-27 16:39 ` Anatol Pomozov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130626210820.GA17564@redhat.com \
--to=vgoyal-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=anatol.pomozov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox