From mboxrd@z Thu Jan 1 00:00:00 1970 From: Balbir Singh Subject: Re: [PATCH][ just for review] memory controller enhancements [4/5] statistics for memory cgroup Date: Tue, 16 Oct 2007 09:25:43 +0530 Message-ID: <4714363F.5010101@linux.vnet.ibm.com> References: <20071015154603.050d43f6.kamezawa.hiroyu@jp.fujitsu.com> <20071015223823.573411BF4D9@siro.lan> <20071016120311.b1f8bb7d.kamezawa.hiroyu@jp.fujitsu.com> Reply-To: balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20071016120311.b1f8bb7d.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: KAMEZAWA Hiroyuki Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org, YAMAMOTO Takashi List-Id: containers.vger.kernel.org KAMEZAWA Hiroyuki wrote: > On Tue, 16 Oct 2007 07:38:23 +0900 (JST) > yamamoto-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org (YAMAMOTO Takashi) wrote: > >>>>> +/* >>>>> + * For batching....mem_cgroup_charge_statistics()(see below). >>>>> + */ >>>>> +static inline void mem_cgroup_stat_add(struct mem_cgroup_stat *stat, >>>>> + enum mem_cgroup_stat_index idx, int val) >>>>> +{ >>>>> + int cpu = smp_processor_id(); >>>>> + stat->cpustat[cpu].count[idx] += val; >>>>> +} >>>> i think the function name should be something which implies batching. >>>> >>> Hm, How about this ? >>> == >>> mem_cgroup_stat_add_atomic() >>> == >>> and add this >>> == >>> VM_BUG_ON(preempt_count() == 0) >>> == >> _atomic sounds like a different thing to me. _nonpreemptible? >> > Hmm, ok. > > Thanks, > -Kame > How about we call it __mem_cgroup_add_stat() and add a comment stating that the routine should be called with pre-emption disabled? We can also add the VM_BUG_ON() suggested. -- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL