Re: [RFC][PATCH 5/4] memcg: don't call res_counter_uncharge whenobsolete

From: Balbir Singh
Date: Thu Jan 15 2009 - 00:57:21 EST


* KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> [2009-01-15 14:14:58]:

> On Thu, 15 Jan 2009 13:38:14 +0900
> Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx> wrote:
>
> > On Thu, 15 Jan 2009 11:14:20 +0900, Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx> wrote:
> > > > > > To handle the problem "parent may be obsolete",
> > > > > >
> > > > > > call mem_cgroup_get(parent) at create()
> > > > > > call mem_cgroup_put(parent) at freeing memcg.
> > > > > > (regardless of use_hierarchy.)
> > > > > >
> > > > > > is clearer way to go, I think.
> > > > > >
> > > > > > I wonder whether there is mis-accounting problem or not..
> > > > > >
> > hmm, after more consideration, although this patch can prevent the BUG,
> > it can leak memsw accounting of parents because memsw of parents, which
> > have been incremented by charge, does not decremented.
> >
> > I'll try pet/put parent approach..
> > Or any other good ideas ?
> >
> >
> I believe get/put at create/destroy is enough now..
> Let's try and see what happens.
>

Other approach could be get_hierarchical/put_hierarchical, but that
can quickly get complex. Let us try and avoid it, unless nothing else
works.

--
Balbir
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/