Re: [PATCH v3 2/3] mm, oom: remove redundant task_in_mem_cgroup() check
From: Shakeel Butt
Date: Thu Jun 27 2019 - 22:13:01 EST
On Tue, Jun 25, 2019 at 11:38 PM Michal Hocko <mhocko@xxxxxxxxxx> wrote:
>
> On Mon 24-06-19 14:26:30, Shakeel Butt wrote:
> > oom_unkillable_task() can be called from three different contexts i.e.
> > global OOM, memcg OOM and oom_score procfs interface. At the moment
> > oom_unkillable_task() does a task_in_mem_cgroup() check on the given
> > process. Since there is no reason to perform task_in_mem_cgroup()
> > check for global OOM and oom_score procfs interface, those contexts
> > provide NULL memcg and skips the task_in_mem_cgroup() check. However for
> > memcg OOM context, the oom_unkillable_task() is always called from
> > mem_cgroup_scan_tasks() and thus task_in_mem_cgroup() check becomes
> > redundant. So, just remove the task_in_mem_cgroup() check altogether.
>
> Just a nit. Not only it is redundant but it is effectively a dead code
> after your previous patch.
>
I will update the commit message.
> > Signed-off-by: Shakeel Butt <shakeelb@xxxxxxxxxx>
> > Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
>
> Acked-by: Michal Hocko <mhocko@xxxxxxxx>
Thanks