Re: [PATCH -mmotm 5/8] memcg: add interface to recharge at task move

KAMEZAWA Hiroyuki
2009-11-06T06:09:15Z

On Fri, 6 Nov 2009 14:14:18 +0900
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:

> In current memcg, charges associated with a task aren't moved to the new cgroup
> at task move. These patches are for this feature, that is, for recharging to
> the new cgroup and, of course, uncharging from old cgroup at task move.
>
> This patch adds "memory.recharge_at_immigrate" file, which is a flag file to
> determine whether charges should be moved to the new cgroup at task move or
> not, and read/write handlers of the file.
> This patch also adds no-op handlers for this feature. These handlers will be
> implemented in later patches.
>
> Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>

Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

BTW, Even if this patch is just for interface, adding Documentation here
is a good choice, I think. It makes things clear.

> +
> + if (mem->recharge_at_immigrate && thread_group_leader(p))
> + ret = mem_cgroup_can_recharge(mem, p);

My small concern is whtehter thread_group_leader(p) is _always_ equal to
mm->owner..If not, things will be complicated.

Could you clarify ? If mm->owner is better, we should use mm->owner here.
(Non-usual case but..)

Thanks,
-Kame