linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: mhocko@kernel.org, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	viro@zeniv.linux.org.uk, kirill.shutemov@linux.intel.com,
	riel@redhat.com
Subject: Re: [PATCH] mm: Check for SIGKILL inside dup_mmap() loop.
Date: Tue, 3 Apr 2018 20:32:39 +0900	[thread overview]
Message-ID: <201804032032.GHF09826.MLOQFtSOFHJOFV@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <20180403111640.GN5501@dhcp22.suse.cz>

Michal Hocko wrote:
> On Thu 29-03-18 14:30:03, Andrew Morton wrote:
> [...]
> > Dumb question: if a thread has been oom-killed and then tries to
> > allocate memory, should the page allocator just fail the allocation
> > attempt?  I suppose there are all sorts of reasons why not :(
> 
> We give those tasks access to memory reserves to move on (see
> oom_reserves_allowed) and fail allocation if reserves do not help
> 
> 	if (tsk_is_oom_victim(current) &&
> 	    (alloc_flags == ALLOC_OOM ||
> 	     (gfp_mask & __GFP_NOMEMALLOC)))
> 		goto nopage;
> So we...
> 
> > In which case, yes, setting a new
> > PF_MEMALLOC_MAY_FAIL_IF_I_WAS_OOMKILLED around such code might be a
> > tidy enough solution.  It would be a bit sad to add another test in the
> > hot path (should_fail_alloc_page()?), but geeze we do a lot of junk
> > already.
> 
> ... do not need this.

Excuse me? But that check is after

	/* Reclaim has failed us, start killing things */
	page = __alloc_pages_may_oom(gfp_mask, order, ac, &did_some_progress);
	if (page)
		goto got_pg;

which means that tsk_is_oom_victim(current) && alloc_flags == ALLOC_OOM threads
can still trigger the OOM killer as soon as the OOM reaper sets MMF_OOM_SKIP.

  reply	other threads:[~2018-04-03 11:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 11:27 Tetsuo Handa
2018-03-29 21:30 ` Andrew Morton
2018-03-30 10:34   ` Tetsuo Handa
2018-04-03 12:14     ` Matthew Wilcox
2018-04-03 12:19       ` Michal Hocko
2018-04-03 12:25         ` Matthew Wilcox
2018-04-03 14:54           ` Tetsuo Handa
2018-04-03 12:29         ` Tetsuo Handa
2018-04-03 13:06           ` Michal Hocko
2018-04-03 11:16   ` Michal Hocko
2018-04-03 11:32     ` Tetsuo Handa [this message]
2018-04-03 11:38       ` Michal Hocko
2018-04-03 11:58   ` Matthew Wilcox
2018-04-03 12:08     ` Michal Hocko
2018-04-07 10:38   ` Tetsuo Handa
2018-04-18 21:44     ` Andrew Morton
2018-04-19  1:54       ` Tetsuo Handa
2018-04-19  2:32         ` Andrew Morton
2018-06-07 22:05           ` Andrew Morton
2018-06-08 17:05             ` Matthew Wilcox

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=201804032032.GHF09826.MLOQFtSOFHJOFV@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=riel@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /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