From: Michal Hocko <mhocko@kernel.org>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: "Shakeel Butt" <shakeelb@google.com>,
syzbot <syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
"Roman Gushchin" <guro@fb.com>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Jérôme Glisse" <jglisse@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
"Linux MM" <linux-mm@kvack.org>,
syzkaller-bugs <syzkaller-bugs@googlegroups.com>,
yuzhoujian@didichuxing.com
Subject: Re: general protection fault in oom_unkillable_task
Date: Mon, 17 Jun 2019 12:13:10 +0200 [thread overview]
Message-ID: <20190617101310.GB1492@dhcp22.suse.cz> (raw)
In-Reply-To: <268214f9-18ef-b63e-2d4f-c344a7dd5e72@i-love.sakura.ne.jp>
On Mon 17-06-19 18:56:47, Tetsuo Handa wrote:
> On 2019/06/17 15:33, Michal Hocko wrote:
> > On Sat 15-06-19 09:11:37, Shakeel Butt wrote:
> >> On Sat, Jun 15, 2019 at 6:50 AM Michal Hocko <mhocko@kernel.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.
> >
> > Right you are. Doing a similar trick to the oom victim selection is
> > indeed better. We should really strive to not doing a global process
> > iteration when we can do a targeted scan. Care to send a patch?
>
> I posted a patch that (as a side effect) avoids oom_unkillable_task() from dump_tasks() at
> https://lore.kernel.org/linux-mm/1558519686-16057-2-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp/ .
> What do you think?
I am sorry but I didn't get to look at this series yet. Anyway, changing
the dump_tasks to use a cgroup iterator for the memcg oom sounds like a
straight forward thing to do without making much more changes around.
Global task list iteration under a single RCU is a more complex problem
that is not limited to the OOM path.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2019-06-17 10:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-15 1:08 general protection fault in oom_unkillable_task syzbot
2019-06-15 1:10 ` Tetsuo Handa
2019-06-15 15:59 ` Tetsuo Handa
2019-06-15 3:15 ` Shakeel Butt
2019-06-15 13:49 ` Michal Hocko
2019-06-15 16:11 ` Shakeel Butt
2019-06-15 16:48 ` Tetsuo Handa
2019-06-15 18:50 ` Shakeel Butt
2019-06-15 21:33 ` Tetsuo Handa
2019-06-16 7:37 ` Tetsuo Handa
2019-06-16 15:13 ` Tetsuo Handa
2019-06-17 6:31 ` Michal Hocko
2019-06-17 13:23 ` Shakeel Butt
2019-06-18 1:45 ` Andrew Morton
2019-06-18 4:21 ` Shakeel Butt
2019-06-17 6:33 ` Michal Hocko
2019-06-17 9:56 ` Tetsuo Handa
2019-06-17 10:13 ` Michal Hocko [this message]
2019-06-16 5:48 ` Hillf Danton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190617101310.GB1492@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=jglisse@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=shakeelb@google.com \
--cc=syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=yuzhoujian@didichuxing.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).