public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Balaji Rao <balajirrao@gmail.com>
Cc: dhaval@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
	containers@lists.osdl.org, menage@google.com, balbir@in.ibm.com,
	vatsa@linux.vnet.ibm.com, a.p.zijlstra@chello.nl,
	Eric Dumazet <dada1@cosmosbay.com>
Subject: Re: [RFC][-mm] Simple stats for cpu resource controller v3
Date: Fri, 2 May 2008 17:19:38 -0700	[thread overview]
Message-ID: <20080502171938.bcb27121.akpm@linux-foundation.org> (raw)
In-Reply-To: <200805030526.46750.balajirrao@gmail.com>

On Sat, 3 May 2008 05:26:46 +0530
Balaji Rao <balajirrao@gmail.com> wrote:

> > yes, that would be good.
> OK, so when does account_system_time get called for the first time ? after 
> IRQs are set up, is it ? So, where do we place the hook ?

Don't know - I'd need to dive in and work that out, and it's probably
better than you do this..

> Here's the patch.
> 
> diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
> index 9007ccd..8a1b756 100644
> --- a/include/linux/percpu_counter.h
> +++ b/include/linux/percpu_counter.h
> @@ -21,7 +21,7 @@ struct percpu_counter {
>  #ifdef CONFIG_HOTPLUG_CPU
>  	struct list_head list;	/* All percpu_counters are on a list */
>  #endif
> -	s32 *counters;
> +	s32 counters[NR_CPUS];
>  };

Please, no.  That's a 4092-byte increase in sizeof(struct percpu_counter). 
Hence a 12 kbyte increase in sizeof(struct ext3_sb_info).  Let's just sort
out the cgroup startup ordering.



<looks at __percpu_alloc_mask>
<wanders off-topic>

Eric, is that optimal?  alloc_percpu() will pass down cpu_possible_map in
`mask', and we only need to allocate enough slots to cover the
highest-set-bit in cpu_possible_map.  However the implementation ignores
`mask' and does 

        size_t sz = roundup(nr_cpu_ids * sizeof(void *), cache_line_size());
        void *pdata = kzalloc(sz, gfp);

Now, if the highest-set-bit in cpu_possible_map is always equal to
(1<<nr_cpu_ids) then it doesn't matter.  But is that the case?

(If someone calls __percpu_alloc_mask with something that has less bits set
than cpu_possible_map then it surely is wasteful, but that sounds
unlikely).


  reply	other threads:[~2008-05-03  0:20 UTC|newest]

Thread overview: 24+ 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
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 [this message]
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

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=20080502171938.bcb27121.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=balajirrao@gmail.com \
    --cc=balbir@in.ibm.com \
    --cc=containers@lists.osdl.org \
    --cc=dada1@cosmosbay.com \
    --cc=dhaval@linux.vnet.ibm.com \
    --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