From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936447AbYEBTxv (ORCPT ); Fri, 2 May 2008 15:53:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S936305AbYEBTx3 (ORCPT ); Fri, 2 May 2008 15:53:29 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:45675 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936297AbYEBTx2 (ORCPT ); Fri, 2 May 2008 15:53:28 -0400 Date: Fri, 2 May 2008 12:53:04 -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 Subject: Re: [RFC][-mm] Simple stats for cpu resource controller v3 Message-Id: <20080502125304.77dd38ba.akpm@linux-foundation.org> In-Reply-To: <200805030110.29511.balajirrao@gmail.com> References: <200804052339.46632.balajirrao@gmail.com> <200805012311.06797.balajirrao@gmail.com> <20080501140026.6188065e.akpm@linux-foundation.org> <200805030110.29511.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 01:10:28 +0530 Balaji Rao wrote: > On Friday 02 May 2008 02:30:26 am Andrew Morton wrote: > > > Hi Andrew, > > Thank you for the review. > > > > Did you consider using include/linux/percpu_counter.h? > > > > If so, what was wrong with it? > > > > Because it would be much better to fix per-cpu counters than to invent new > > stuff. > No, I hadn't consider using the percpu_counters infrastructure. But today when > I tried using it, I got an early exception.I guess its because I tried > calling percpu_counter_init from within sched_init, which I perhaps shouldn't > do, because percpu_counter_init expects cpu hotplug code to be initialized by > then. Right ? Correct me if I'm wrong. I don't see any reason why we cannot run percpu_counter_init() prior to running percpu_counter_startup(). And it is desirable that we be able to start using the percpu-counters quite early. Can you debug it a bit please? It's probably some silly little thing, perhaps fixable by calling percpu_counter_startup() earlier. > How about we start collecting statistics at a later stage i.e, after > percpu_counter becomes usable ? It would be better to make the core infrastructure more robust, rather than working around problems it might have. It's rather nice that percpu_counters internally take care of cpu-hotplugging, and use cpu_online_map. I was amazed at how easily that was added. I still expect it to break somehow..