From: David Rientjes <rientjes@google.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Michal Hocko <mhocko@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch] mm, oom: dump stack of victim when reaping failed
Date: Thu, 16 Jan 2020 13:05:56 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.21.2001161301570.101032@chino.kir.corp.google.com> (raw)
In-Reply-To: <84fddb8e-a23b-e970-c8e9-74aa2fe2716d@i-love.sakura.ne.jp>
On Thu, 16 Jan 2020, Tetsuo Handa wrote:
> > I'm
> > currently tracking a stall in oom reaping where the victim doesn't always
> > have a lock held so we don't know where it's at in the kernel; I'm hoping
> > that a stack for the thread group leader will at least shed some light on
> > it.
> >
>
> This change was already proposed at
> https://lore.kernel.org/linux-mm/20180320122818.GL23100@dhcp22.suse.cz/ .
>
Hmm, seems the patch didn't get followed up on but I obviously agree with
it :)
> And according to that proposal, it is likely i_mmap_lock_write() in dup_mmap()
> in copy_process(). We tried to make that lock killable but we gave it up
> because nobody knows whether it is safe to do make it killable.
>
I haven't encountered that particular problem yet; one problem that I've
found is a victim holding cgroup_threadgroup_rwsem in the exit path,
another problem is the victim not holding any locks at all which is more
concerning (why isn't it making forward progress?). This patch intends to
provide a clue for the latter.
Aside: we may also want to consider the possibility of doing immediate
additional oom killing if the initial victim is too small. We rely on the
oom reaper to solve livelocks like this by freeing memory so that
allocators can drop locks that the victim depends on. If the victim is
too small (we have victims <1MB because of oom_score_adj +1000!) we may
want to consider additional immediate oom killing because it simply won't
free enough memory.
prev parent reply other threads:[~2020-01-16 21:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-14 23:20 David Rientjes
2020-01-15 8:43 ` Michal Hocko
[not found] ` <9a7cbbf0-4283-f932-e422-84b4fb42a055@I-love.SAKURA.ne.jp>
2020-01-15 20:27 ` David Rientjes
[not found] ` <84fddb8e-a23b-e970-c8e9-74aa2fe2716d@i-love.sakura.ne.jp>
2020-01-16 21:05 ` David Rientjes [this message]
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=alpine.DEB.2.21.2001161301570.101032@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/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