Re: [PATCH 2/2] memcg: relocate charge moving from ->attach to ->post_attach

From: Tejun Heo
Date: Mon Apr 25 2016 - 15:42:56 EST


Hello, Michal.

On Mon, Apr 25, 2016 at 10:25:42AM +0200, Michal Hocko wrote:
> > * move_charge_struct->mm is added and ->can_attach is now responsible
> > for pinning and recording the target mm. mem_cgroup_clear_mc() is
> > updated accordingly. This also simplifies mem_cgroup_move_task().
> >
> > * mem_cgroup_move_task() is now called from ->post_attach instead of
> > ->attach.
>
> This looks much better than the previous quick&dirty workaround. Thanks
> for taking an extra step!
>
> Sorry for being so pushy but shouldn't we at least document those
> callbacks which depend on cgroup_threadgroup_rwsem to never ever block
> on WQ directly or indirectly. Maybe even enforce they have to be
> non-blocking. This would be out of scope of this particular patch of
> course but it would fit nicely into the series.

Yeah, I'll look into whether I can annotate this dependency with
lockdep. If that isn't doable, I'll document the requirements.
cgroup methods have changed a lot and need to be redocumented anyway.

Thanks.

--
tejun