Re: [PATCH v5 09/14] memcg: kmem accounting lifecycle management

2012-10-18 Thread Glauber Costa
On 10/18/2012 03:28 AM, David Rientjes wrote: > On Tue, 16 Oct 2012, Glauber Costa wrote: > >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c >> index 1182188..e24b388 100644 >> --- a/mm/memcontrol.c >> +++ b/mm/memcontrol.c >> @@ -344,6 +344,7 @@ struct mem_cgroup { >> /* internal only represent

Re: [PATCH v5 09/14] memcg: kmem accounting lifecycle management

2012-10-17 Thread Michal Hocko
On Wed 17-10-12 16:28:38, David Rientjes wrote: > On Tue, 16 Oct 2012, Glauber Costa wrote: [...] > > + > > +static void memcg_kmem_mark_dead(struct mem_cgroup *memcg) > > +{ > > + if (test_bit(KMEM_ACCOUNTED_ACTIVE, &memcg->kmem_accounted)) > > + set_bit(KMEM_ACCOUNTED_DEAD, &memcg->km

Re: [PATCH v5 09/14] memcg: kmem accounting lifecycle management

2012-10-17 Thread David Rientjes
On Tue, 16 Oct 2012, Glauber Costa wrote: > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 1182188..e24b388 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -344,6 +344,7 @@ struct mem_cgroup { > /* internal only representation about the status of kmem accounting. */ > enum {

[PATCH v5 09/14] memcg: kmem accounting lifecycle management

2012-10-16 Thread Glauber Costa
Because kmem charges can outlive the cgroup, we need to make sure that we won't free the memcg structure while charges are still in flight. For reviewing simplicity, the charge functions will issue mem_cgroup_get() at every charge, and mem_cgroup_put() at every uncharge. This can get expensive, ho