Re: [RFC][BUGFIX] memcg: rmdir doesn't return

KAMEZAWA Hiroyuki
2009-06-15T03:03:45Z

On Mon, 15 Jun 2009 11:50:21 +0900
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:

> > Then, my suggestion is here.
> > ==
> > } else {
> > ent.val = page_private(page);
> > id = lookup_swap_cgroup(ent);
> > rcu_read_lock();
> > mem = mem_cgroup_lookup(id);
> > if (mem) {
> > if (css_tryget(mem->css)) {
> > /*
> > * If no processes in this cgroup, accounting back to
> > * this cgroup seems silly and prevents RMDIR.
> > */
> > struct cgroup *cg = mem->css.cgroup;
> > if (!atomic_read(&cg->count) && list_empty(&cg->children)) {
> > css_put(&mem->css);
> > mem = NULL;
> > }
> > }
> > rcu_read_unlock();
> > }
> > ==
> >
> Thank you for your suggestion.
> To be honest, I think swap cache behavior would be complicated anyway :(
>
> I prefer my change because the behavior would become consistent with
> the case we don't use mem+swap controller and with the behavior of page cache.
>
I don't like implict resource move. I'll try some today. plz see it.
_But_ this case just happens when swap is shared between cgroups and _very_ heavy
swap-in continues very long. I don't think this is a fatal and BUG.

But ok, maybe wake-up path is not enough.

Thanks,
-Kame