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

From: KAMEZAWA Hiroyuki
Date: Wed Jan 14 2009 - 21:50:15 EST


On Wed, 14 Jan 2009 19:25:39 +0530
Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> wrote:

> * Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx> [2009-01-14 17:51:21]:
>
> > This is a new one. Please review.
> >
> > ===
> > From: Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx>
> >
> > mem_cgroup_get ensures that the memcg that has been got can be accessed
> > even after the directory has been removed, but it doesn't ensure that parents
> > of it can be accessed: parents might have been freed already by rmdir.
> >
> > This causes a bug in case of use_hierarchy==1, because res_counter_uncharge
> > climb up the tree.
> >
> > Check if the memcg is obsolete, and don't call res_counter_uncharge when obsole.
> >
> > Signed-off-by: Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx>
>
> I liked the earlier, EBUSY approach that ensured that parents could
> not go away if children exist. IMHO, the code has gotten too complex
> and has too many corner cases. Time to revisit it.
>
It's on my plan.
I'll fix this by CSS-ID patch.

When I recored memcg's CSS-ID to swap_cgroup (not pointer to memcg),
we never need memcg's refcnt.

Thanks,
-Kame

--
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/