OpenVZ Forum


Home » Mailing lists » Devel » [PATCH][ just for review] memory controller enhancements [0/5]
Re: [PATCH][ just for review] memory controller enhancements [4/5] statistics for memory cgroup [message #21765 is a reply to message #21762] Tue, 16 October 2007 03:55 Go to previous messageGo to previous message
Balbir Singh is currently offline  Balbir Singh
Messages: 491
Registered: August 2006
Senior Member
KAMEZAWA Hiroyuki wrote:
> On Tue, 16 Oct 2007 07:38:23 +0900 (JST)
> yamamoto@valinux.co.jp (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
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Guidance required...
Next Topic: CONFIG_NAMESPACE* patchset
Goto Forum:
  


Current Time: Wed Jul 23 06:04:16 GMT 2025

Total time taken to generate the page: 0.11936 seconds