Re: [PATCH v2] mm,oom: exclude oom_task_origin processes if they are OOM-unkillable.

From: Michal Hocko
Date: Fri Feb 19 2016 - 10:14:00 EST


On Sat 20-02-16 00:07:05, Tetsuo Handa wrote:
> Michal Hocko wrote:
> > On Thu 18-02-16 13:08:49, Michal Hocko wrote:
> > > I guess we can safely remove the memcg
> > > argument from oom_badness and oom_unkillable_task. At least from a quick
> > > glance...
> >
> > No we cannot actually. oom_kill_process could select a child which is in
> > a different memcg in that case...
>
> Then, don't we need to check whether processes sharing victim->mm in other
> thread groups are in the same memcg when we walk the process list?

memcg is bound to the mm not to the task. So all processes sharing the
mm after in the same memcg (from the memcg POV). See tast_struct::owner.
--
Michal Hocko
SUSE Labs