From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: linux-kernel@vger.kernel.org, Balaji Rao <balajirrao@gmail.com>,
Dhaval Giani <dhaval@linux.vnet.ibm.com>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Li Zefan <lizf@cn.fujitsu.com>, Paul Menage <menage@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [RFC PATCH 2/2] Add per-cgroup CPU controller statistics
Date: Wed, 25 Feb 2009 16:50:03 +0530 [thread overview]
Message-ID: <20090225112003.GD4008@in.ibm.com> (raw)
In-Reply-To: <1235559850.4645.3210.camel@laptop>
On Wed, Feb 25, 2009 at 12:04:10PM +0100, Peter Zijlstra wrote:
> On Wed, 2009-02-25 at 16:29 +0530, Bharata B Rao wrote:
> > From: Balaji Rao <balajirrao@gmail.com>
> >
> > sched: Add cpu controller statistics
> >
> > Add per-cgroup cpu controller statistics like system time and user time
> > consumed by groups of tasks.
>
> Do we want this unconditionally?
Not sure if I understand you correctly here, but we are collecting
stats only when CONFIG_CGROUP_SCHED.
Or do you mean we need a config option to enable stats collection ?
If so, we have memory controller already providing stats unconditionally.
> >
> > +#ifdef CONFIG_CGROUP_SCHED
> > +static void account_task_group_time(struct task_struct *p,
> > + enum cpu_cgroup_stat_index idx, int val)
> > +{
> > + struct task_group *tg = task_group(p);
> > +
> > + if (likely(tg->stat))
> > + percpu_counter_add(&tg->stat->cpustat[idx], val);
> > +}
> > +#else
> > +#define account_task_group_time(x, y, z) { 0; }
>
> inline please, so we get argument validation.
Actually wanted to inline, but one of the arguments (cpu_cgroup_stat_index)
is defined only CONFIG_CGROUP_SCHED. Hence didn't want argument
validation here.
> > +
> > + for (i = 0; i < CPU_CGROUP_STAT_NSTATS; i++)
> > + percpu_counter_init(&tg->stat->cpustat[i], 0);
>
> percpu_counter_init() can fail with -ENOMEM.
Ok, will fix.
Thanks for your review, Peter.
Regards,
Bharata.
next prev parent reply other threads:[~2009-02-25 11:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-25 10:57 [RFC PATCH 0/2] CPU controller statistics - v5 Bharata B Rao
2009-02-25 10:58 ` [RFC PATCH 1/2] New cgroup subsystem API (->initialize()) Bharata B Rao
2009-02-26 2:55 ` Li Zefan
2009-02-26 7:52 ` Bharata B Rao
2009-02-26 8:11 ` Li Zefan
2009-02-26 8:20 ` KAMEZAWA Hiroyuki
2009-02-26 10:12 ` Bharata B Rao
2009-02-26 8:48 ` Dhaval Giani
2009-02-26 8:52 ` Li Zefan
2009-02-25 10:59 ` [RFC PATCH 2/2] Add per-cgroup CPU controller statistics Bharata B Rao
2009-02-25 11:04 ` Peter Zijlstra
2009-02-25 11:20 ` Bharata B Rao [this message]
2009-02-25 11:24 ` Peter Zijlstra
2009-02-25 11:41 ` Bharata B Rao
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=20090225112003.GD4008@in.ibm.com \
--to=bharata@linux.vnet.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=balajirrao@gmail.com \
--cc=balbir@linux.vnet.ibm.com \
--cc=dhaval@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
--cc=mingo@elte.hu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.