[Devel] Re: [PATCH v4 04/14] kmem accounting basic infrastructure

2012-10-12 Thread Michal Hocko
On Fri 12-10-12 11:36:38, Glauber Costa wrote: > On 10/11/2012 02:11 PM, Michal Hocko wrote: > > On Mon 08-10-12 14:06:10, Glauber Costa wrote: [...] > >> + if (!memcg->kmem_accounted && val != RESOURCE_MAX) { > > > > Just a nit but wouldn't memcg_kmem_is_accounted(memcg) be better than > > direc

[Devel] Re: [PATCH v4 04/14] kmem accounting basic infrastructure

2012-10-12 Thread Glauber Costa
On 10/11/2012 02:11 PM, Michal Hocko wrote: > On Mon 08-10-12 14:06:10, Glauber Costa wrote: >> This patch adds the basic infrastructure for the accounting of the slab >> caches. To control that, the following files are created: >> >> * memory.kmem.usage_in_bytes >> * memory.kmem.limit_in_bytes >

[Devel] Re: [PATCH v4 04/14] kmem accounting basic infrastructure

2012-10-11 Thread Michal Hocko
On Thu 11-10-12 12:11:19, Michal Hocko wrote: > On Mon 08-10-12 14:06:10, Glauber Costa wrote: > > + cgroup_lock(); > > + mutex_lock(&set_limit_mutex); > > + if (!memcg->kmem_accounted && val != RESOURCE_MAX) { > > Just a nit but wouldn't memcg_kmem_is_accounted(memcg) be better than > dire

[Devel] Re: [PATCH v4 04/14] kmem accounting basic infrastructure

2012-10-11 Thread Michal Hocko
On Thu 11-10-12 12:11:19, Michal Hocko wrote: > On Mon 08-10-12 14:06:10, Glauber Costa wrote: [...] > > +static void memcg_kmem_set_active(struct mem_cgroup *memcg) > > +{ > > + set_bit(KMEM_ACCOUNTED_ACTIVE, &memcg->kmem_accounted); > > +} > > + > > +static bool memcg_kmem_is_accounted(struct m

[Devel] Re: [PATCH v4 04/14] kmem accounting basic infrastructure

2012-10-11 Thread Michal Hocko
On Mon 08-10-12 14:06:10, Glauber Costa wrote: > This patch adds the basic infrastructure for the accounting of the slab > caches. To control that, the following files are created: > > * memory.kmem.usage_in_bytes > * memory.kmem.limit_in_bytes > * memory.kmem.failcnt > * memory.kmem.max_usage