From: Michal Hocko <mhocko@suse.cz>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: david@fromorbit.com, hannes@cmpxchg.org,
akpm@linux-foundation.org, aarcange@redhat.com,
rientjes@google.com, vbabka@suse.cz, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/9] mm: improve OOM mechanism v2
Date: Thu, 30 Apr 2015 16:25:35 +0200 [thread overview]
Message-ID: <20150430142534.GA16964@dhcp22.suse.cz> (raw)
In-Reply-To: <201504301844.CFE13027.FOMtJHQOFSOFVL@I-love.SAKURA.ne.jp>
On Thu 30-04-15 18:44:25, Tetsuo Handa wrote:
> Michal Hocko wrote:
> > I mean we should eventually fail all the allocation types but GFP_NOFS
> > is coming from _carefully_ handled code paths which is an easier starting
> > point than a random code path in the kernel/drivers. So can we finally
> > move at least in this direction?
>
> I agree that all the allocation types can fail unless GFP_NOFAIL is given.
> But I also expect that all the allocation types should not fail unless
> order > PAGE_ALLOC_COSTLY_ORDER or GFP_NORETRY is given or chosen as an OOM
> victim.
Yeah, let's keep shooting our feet and then look for workarounds to deal
with it...
> We already experienced at Linux 3.19 what happens if !__GFP_FS allocations
> fails. out_of_memory() is called by pagefault_out_of_memory() when 0x2015a
> (!__GFP_FS) allocation failed.
I have posted a patch to deal with this
(http://marc.info/?l=linux-mm&m=142770374521952&w=2). There is no real
reason to do the GFP_NOFS from the page fault context just because the
mapping _always_ insists on it. Page fault simply _has_ to be GFP_FS
safe, we are badly broken otherwise. That patch should go in hand with
GFP_NOFS might fail one. I haven't posted it yet because I was waiting
for the merge window to close.
> This looks to me that !__GFP_FS allocations
> are effectively OOM killer context. It is not fair to kill the thread which
> triggered a page fault, for that thread may not be using so much memory
> (unfair from memory usage point of view) or that thread may be global init
> (unfair because killing the entire system than survive by killing somebody).
Why would we kill the faulting process?
> Also, failing the GFP_NOFS/GFP_NOIO allocations which are not triggered by
> a page fault generally causes more damage (e.g. taking filesystem error
> action) than survive by killing somebody. Therefore, I think we should not
> hesitate invoking the OOM killer for !__GFP_FS allocation.
No, we should fix those places and use proper gfp flags rather than
pretend that the problem doesn't exist and deal with all the side
effectes.
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-04-30 14:25 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-27 19:05 [PATCH 0/9] mm: improve OOM mechanism v2 Johannes Weiner
2015-04-27 19:05 ` [PATCH 1/9] mm: oom_kill: remove unnecessary locking in oom_enable() Johannes Weiner
2015-04-27 19:05 ` [PATCH 2/9] mm: oom_kill: clean up victim marking and exiting interfaces Johannes Weiner
2015-04-27 19:05 ` [PATCH 3/9] mm: oom_kill: switch test-and-clear of known TIF_MEMDIE to clear Johannes Weiner
2015-04-27 19:05 ` [PATCH 4/9] mm: oom_kill: generalize OOM progress waitqueue Johannes Weiner
2015-04-28 22:40 ` David Rientjes
2015-04-27 19:05 ` [PATCH 5/9] mm: oom_kill: remove unnecessary locking in exit_oom_victim() Johannes Weiner
2015-04-28 22:40 ` David Rientjes
2015-04-27 19:05 ` [PATCH 6/9] mm: oom_kill: simplify OOM killer locking Johannes Weiner
2015-04-28 22:43 ` David Rientjes
2015-04-29 5:48 ` Tetsuo Handa
2015-04-27 19:05 ` [PATCH 7/9] mm: page_alloc: inline should_alloc_retry() Johannes Weiner
2015-04-27 19:05 ` [PATCH 8/9] mm: page_alloc: wait for OOM killer progress before retrying Johannes Weiner
2015-04-28 13:18 ` Michal Hocko
2015-04-27 19:05 ` [PATCH 9/9] mm: page_alloc: memory reserve access for OOM-killing allocations Johannes Weiner
2015-04-28 13:30 ` Michal Hocko
2015-04-28 14:59 ` Michal Hocko
2015-04-28 10:34 ` [PATCH 0/9] mm: improve OOM mechanism v2 Tetsuo Handa
2015-04-28 13:55 ` Michal Hocko
2015-04-28 15:50 ` Tetsuo Handa
2015-04-29 12:55 ` Johannes Weiner
2015-04-29 14:40 ` Michal Hocko
2015-04-29 17:27 ` Tetsuo Handa
2015-04-29 18:31 ` Michal Hocko
2015-04-30 9:44 ` Tetsuo Handa
2015-04-30 14:25 ` Michal Hocko [this message]
2015-05-23 14:42 ` Tetsuo Handa
2015-05-04 18:02 ` Johannes Weiner
2015-05-04 19:01 ` Michal Hocko
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=20150430142534.GA16964@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=david@fromorbit.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=rientjes@google.com \
--cc=vbabka@suse.cz \
/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).