linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: mjaggi@caviumnetworks.com, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, rientjes@google.com, mhocko@suse.com,
	oleg@redhat.com, vdavydov.dev@gmail.com
Subject: Re: [PATCH] mm, oom: task_will_free_mem(current) should ignore MMF_OOM_SKIP for once.
Date: Sat, 5 Aug 2017 00:54:46 +0900	[thread overview]
Message-ID: <201708050054.FDD64564.tMQSVOFOFOLFJH@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <201708050024.ABD87010.SFFOVQOFOJMHtL@I-love.SAKURA.ne.jp>

Tetsuo Handa wrote:
> Manish Jaggi wrote:
> > Wanted to understand the envisaged effect of this patch
> > - would this patch kill the task fully or it will still take few more 
> > iterations of oom-kill to kill other process to free memory
> > - when I apply this patch I see other tasks getting killed, though I 
> > didnt got panic in initial testing, I saw login process getting killed.
> > So I am not sure if this patch works...
> 
> Thank you for testing. This patch is working as intended.
> 
> This patch (or any other patches) won't wait for the OOM victim (in this case
> oom02) to be fully killed. We don't want to risk OOM lockup situation by waiting
> for the OOM victim to be fully killed. If the OOM reaper kernel thread waits for
> the OOM victim forever, different OOM stress will trigger OOM lockup situation.
> Thus, the OOM reaper kernel thread gives up waiting for the OOM victim as soon as
> memory which can be reclaimed before __mmput() from mmput() from exit_mm() from
> do_exit() is called is reclaimed and sets MMF_OOM_SKIP.
> 
> Other tasks might be getting killed, for threads which task_will_free_mem(current)
> returns false will call select_bad_process() and select_bad_process() will ignore
> existing OOM victims with MMF_OOM_SKIP already set. Compared to older kernels
> which do not have the OOM reaper support, this behavior looks like a regression.
> But please be patient. This behavior is our choice for not to risk OOM lockup
> situation.
> 
> This patch will prevent _all_ threads which task_will_free_mem(current) returns
> true from calling select_bad_process(). And Michal's patch will prevent _most_
> threads which task_will_free_mem(current) returns true from calling select_bad_process().
> Since oom02 has many threads which task_will_free_mem(current) returns true,
> this patch (or Michal's patch) will reduce possibility of killing all threads.
> 

Oh, the last line was confusing.

Since oom02 has many threads which task_will_free_mem(current) returns true,
this patch (or Michal's patch) will reduce possibility of killing other tasks
(i.e. processes other than oom02) by increasing possibility of allocations by
OOM victim threads (i.e. threads in oom02) to succeed.

--
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>

  reply	other threads:[~2017-08-04 15:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02 23:55 [PATCH] mm, oom: task_will_free_mem(current) should ignore MMF_OOM_SKIP for once Tetsuo Handa
2017-08-03  0:04 ` Andrew Morton
2017-08-03  7:10 ` Michal Hocko
2017-08-03  7:53   ` Tetsuo Handa
2017-08-03  8:14     ` Michal Hocko
2017-08-04 11:10       ` Tetsuo Handa
2017-08-04 11:26         ` Michal Hocko
2017-08-04 11:44           ` Tetsuo Handa
2017-08-04 11:52             ` Michal Hocko
2017-08-04 11:54 ` Manish Jaggi
2017-08-04 15:24   ` Tetsuo Handa
2017-08-04 15:54     ` Tetsuo Handa [this message]
2017-08-19  6:23 ` [PATCH v2] " Tetsuo Handa
2017-08-21  8:43   ` Michal Hocko
2017-08-21 11:41     ` Tetsuo Handa
2017-08-21 12:10       ` Michal Hocko
2017-08-21 12:57         ` Tetsuo Handa
2017-08-21 13:18           ` 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=201708050054.FDD64564.tMQSVOFOFOLFJH@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=mjaggi@caviumnetworks.com \
    --cc=oleg@redhat.com \
    --cc=rientjes@google.com \
    --cc=vdavydov.dev@gmail.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).