Re: [RFC][PATCH 2/2] memcg: hardwall hierarhcy for memcg

From: Daisuke Nishimura
Date: Wed Jun 04 2008 - 08:55:13 EST


> > > @@ -1096,6 +1238,12 @@ static void mem_cgroup_destroy(struct cg
> > > int node;
> > > struct mem_cgroup *mem = mem_cgroup_from_cont(cont);
> > >
> > > + if (cont->parent &&
> > > + mem->hierarchy_model == MEMCG_HARDWALL_HIERARCHY) {
> > > + /* we did what we can...just returns what we borrow */
> > > + res_counter_return_resource(&mem->res, -1, NULL, 0);
> > > + }
> > > +
> >
> > Should we also re-account any remaining child usage to the parent?
> >
> When this is called, there are no process in this group. Then, remaining
> resources in this level is
> - file cache
> - swap cache (if shared)
> - shmem
>
> And the biggest usage will be "file cache".
> So, I don't think it's necessary to move child's usage to the parent,
> in hurry. But maybe shmem is worth to be moved.
>
> I'd like to revisit this when I implements "usage move at task move"
> logic. (currenty, memory usage doesn't move to new cgroup at task_attach.)
>
> It will help me to implement the logic "move remaining usage to the parent"
> in clean way.
>

I agree that "usage move at task move" is needed before
"move remaining usage to the parent".


Thanks,
Daisuke Nishimura.
--
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/