From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936440AbYECAU5 (ORCPT ); Fri, 2 May 2008 20:20:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932665AbYECAUr (ORCPT ); Fri, 2 May 2008 20:20:47 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:38293 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932630AbYECAUq (ORCPT ); Fri, 2 May 2008 20:20:46 -0400 Date: Fri, 2 May 2008 17:19:38 -0700 From: Andrew Morton To: Balaji Rao 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 Subject: Re: [RFC][-mm] Simple stats for cpu resource controller v3 Message-Id: <20080502171938.bcb27121.akpm@linux-foundation.org> In-Reply-To: <200805030526.46750.balajirrao@gmail.com> References: <200804052339.46632.balajirrao@gmail.com> <200805030457.54073.balajirrao@gmail.com> <20080502164133.9025a02c.akpm@linux-foundation.org> <200805030526.46750.balajirrao@gmail.com> X-Mailer: Sylpheed version 2.2.4 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 3 May 2008 05:26:46 +0530 Balaji Rao 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. 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<