From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: mhocko@suse.cz, david@fromorbit.com
Cc: 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 18:44:25 +0900 [thread overview]
Message-ID: <201504301844.CFE13027.FOMtJHQOFSOFVL@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <20150429183135.GH31341@dhcp22.suse.cz>
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.
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. 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).
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.
> > Likewise, there is possibility that such memory reserve is used by threads
> > which the OOM victim is not waiting for, for malloc() + memset() causes
> > __GFP_FS allocations.
>
> We cannot be certain without complete dependency tracking. This is
> just a heuristic.
Yes, we cannot be certain without complete dependency tracking. And doing
complete dependency tracking is too expensive to implement. Dave is
recommending that we should focus on not to trigger the OOM killer than
how to handle corner cases in OOM conditions, isn't he? I still believe that
choosing more OOM victims upon timeout (which is a heuristic after all) and
invoking the OOM killer for !__GFP_FS allocations are the cheapest and least
surprising. This is something like automatically and periodically pressing
SysRq-f on behalf of the system administrator when memory allocator cannot
recover from low memory situation.
--
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 10:23 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-27 19:05 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 [this message]
2015-04-30 14:25 ` Michal Hocko
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=201504301844.CFE13027.FOMtJHQOFSOFVL@I-love.SAKURA.ne.jp \
--to=penguin-kernel@i-love.sakura.ne.jp \
--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=mhocko@suse.cz \
--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