[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALvZod4etSv9Hv4UD=E6D7U4vyjCqhxQgq61AoTUCd+VubofFg@mail.gmail.com>
Date: Sat, 15 Jun 2019 11:50:31 -0700
From: Shakeel Butt <shakeelb@...gle.com>
To: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Cc: Michal Hocko <mhocko@...nel.org>,
syzbot <syzbot+d0fc9d3c166bc5e4a94b@...kaller.appspotmail.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Roman Gushchin <guro@...com>,
Johannes Weiner <hannes@...xchg.org>,
Jérôme Glisse <jglisse@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Linux MM <linux-mm@...ck.org>,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
yuzhoujian@...ichuxing.com
Subject: Re: general protection fault in oom_unkillable_task
On Sat, Jun 15, 2019 at 9:49 AM Tetsuo Handa
<penguin-kernel@...ove.sakura.ne.jp> wrote:
>
> On 2019/06/16 1:11, Shakeel Butt wrote:
> > On Sat, Jun 15, 2019 at 6:50 AM Michal Hocko <mhocko@...nel.org> wrote:
> >> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> >> index 5a58778c91d4..43eb479a5dc7 100644
> >> --- a/mm/oom_kill.c
> >> +++ b/mm/oom_kill.c
> >> @@ -161,8 +161,8 @@ static bool oom_unkillable_task(struct task_struct *p,
> >> return true;
> >>
> >> /* When mem_cgroup_out_of_memory() and p is not member of the group */
> >> - if (memcg && !task_in_mem_cgroup(p, memcg))
> >> - return true;
> >> + if (memcg)
> >> + return false;
> >
> > This will break the dump_tasks() usage of oom_unkillable_task(). We
> > can change dump_tasks() to traverse processes like
> > mem_cgroup_scan_tasks() for memcg OOMs.
>
> While dump_tasks() traverses only each thread group, mem_cgroup_scan_tasks()
> traverses each thread.
I think mem_cgroup_scan_tasks() traversing threads is not intentional
and css_task_iter_start in it should use CSS_TASK_ITER_PROCS as the
oom killer only cares about the processes or more specifically
mm_struct (though two different thread groups can have same mm_struct
but that is fine).
> To avoid printk()ing all threads in a thread group,
> moving that check to
>
> if (memcg && !task_in_mem_cgroup(p, memcg))
> continue;
>
> in dump_tasks() is better?
>
> >
> >>
> >> /* p may not have freeable memory in nodemask */
> >> if (!has_intersects_mems_allowed(p, nodemask))
>
Powered by blists - more mailing lists