public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dhaval Giani <dhaval@linux.vnet.ibm.com>
To: Balaji Rao <balajirrao@gmail.com>
Cc: linux-kernel@vger.kernel.org, containers@lists.osdl.org,
	menage@google.com, a.p.zijlstra@chello.nl, balbir@in.ibm.com,
	Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Subject: Re: [RFC][-mm] [1/2] Simple stats for cpu resource controller
Date: Sun, 6 Apr 2008 02:29:14 +0530	[thread overview]
Message-ID: <20080405205914.GA25009@linux.vnet.ibm.com> (raw)
In-Reply-To: <200804060201.52726.balajirrao@gmail.com>

On Sun, Apr 06, 2008 at 02:01:52AM +0530, Balaji Rao wrote:
> On Sunday 06 April 2008 01:10:41 am Dhaval Giani wrote:
> > > +};
> > > +
> > > +struct cpu_cgroup_stat_cpu {
> > > +	s64 count[CPU_CGROUP_STAT_NSTATS];
> > 
> > u64? time does not go negative :)
> Right. But these stats are not only going to measure time. We need the same 
> variables for measuring other stats as well. I'm not sure if we would 
> encounter scheduler stats that would count negative.
> 
> Balbir, what do you say ?

I would prefer to keep the stats logically separate. So something like
struct cpu_cgroup_stat_cpu {
	u64 time[];
	s64 some_other_stat;
}
and so on. (I am not sure, is there some advantage gained by using
structs?) Makes the code more maintainable imho.

> 
> > count also is not very clear? Can you give a more descriptive name?
> > 
> ok. How does 'value' look  ?
> 
> <snip>
> 
> > > +static s64 cpu_cgroup_read_stat(struct cpu_cgroup_stat *stat,
> > > +		enum cpu_cgroup_stat_index idx)
> > > +{
> > > +	int cpu;
> > > +	s64 ret = 0;
> > > +	unsigned long flags;
> > 
> > > +
> > > +	local_irq_save(flags);
> > 
> > I am just wondering. Is local_irq_save() enough?
> > 
> Hmmm.. You are right.This does not prevent concurrent updates on other CPUs 
> from crossing a 32bit boundary. Am not sure how to do this in a safe way. I 
> can only think of using atomic64_t now..
> 

I am going to answer that one when I am awake :-)

-- 
regards,
Dhaval

  reply	other threads:[~2008-04-05 20:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-05 18:09 [RFC][-mm] [1/2] Simple stats for cpu resource controller Balaji Rao
2008-04-05 18:56 ` Dhaval Giani
2008-04-05 19:09   ` Balaji Rao
2008-04-05 19:40 ` Dhaval Giani
2008-04-05 20:31   ` Balaji Rao
2008-04-05 20:59     ` Dhaval Giani [this message]
2008-04-05 21:21       ` Balaji Rao
2008-04-06  5:12         ` Balbir Singh
2008-04-07 13:24     ` Peter Zijlstra
2008-04-10 16:09       ` Balaji Rao
2008-04-10 16:25         ` Peter Zijlstra
2008-05-01 17:41           ` [RFC][-mm] Simple stats for cpu resource controller v3 Balaji Rao
2008-05-01 21:00             ` Andrew Morton
2008-05-02 19:40               ` Balaji Rao
2008-05-02 19:53                 ` Andrew Morton
2008-05-02 22:47                   ` Balaji Rao
2008-05-02 23:04                     ` Andrew Morton
     [not found] ` <200805030457.54073.balajirrao@gmail.com>
     [not found]   ` <20080502164133.9025a02c.akpm@linux-foundation.org>
2008-05-02 23:56     ` Balaji Rao
2008-05-03  0:19       ` Andrew Morton
2008-05-11 20:18         ` [RFC][-mm] Simple stats for cpu resource controller v4 Balaji Rao
2008-05-12  2:54           ` Li Zefan
2008-05-12  5:41             ` Balaji Rao
2008-05-12 23:48           ` Andrew Morton
2008-05-13  3:30             ` Balaji Rao
  -- strict thread matches above, loose matches on Subject: below --
2008-03-26 18:18 [RFC][-mm] [1/2] Simple stats for cpu resource controller Balaji Rao
2008-03-26 19:00 ` Paul Menage
2008-03-26 19:58 ` Peter Zijlstra
2008-03-28 10:02   ` Balaji Rao
2008-03-28 10:17     ` Peter Zijlstra

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=20080405205914.GA25009@linux.vnet.ibm.com \
    --to=dhaval@linux.vnet.ibm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=balajirrao@gmail.com \
    --cc=balbir@in.ibm.com \
    --cc=containers@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menage@google.com \
    --cc=vatsa@linux.vnet.ibm.com \
    /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