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
Cc: linux-pm@vger.kernel.org, linux-mm@kvack.org,
	akpm@linux-foundation.org, pavel@ucw.cz, rjw@rjwysocki.net
Subject: Re: [PATCH] mm,oom: Do not unfreeze OOM victim thread.
Date: Fri, 30 Mar 2018 00:52:16 +0900	[thread overview]
Message-ID: <201803300052.AHJ43293.HLVOtOFSQOFFJM@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <20180329145055.GH31039@dhcp22.suse.cz>

Michal Hocko wrote:
> On Thu 29-03-18 23:36:58, Tetsuo Handa wrote:
> > Currently, mark_oom_victim() calls __thaw_task() on the OOM victim
> > threads and freezing_slow_path() unfreezes the OOM victim thread.
> > But I think this exceptional behavior makes little sense nowadays.
> 
> Well, I would like to see this happen because it would allow more
> changes on top. E.g. get rid of TIF_MEMDIE finally.

I'm planning to change mark_oom_victim(tsk) to set TIF_MEMDIE only if
tsk == current. That is, "do not set TIF_MEMDIE on remote thread", for
setting TIF_MEMDIE on a thread which might not be doing memory allocation
is not helpful. Setting TIF_MEMDIE on current thread via
task_will_free_mem(current) in out_of_memory() path is always helpful
because current thread is exactly doing memory allocation.

>                                                     But I am not really
> sure we are there yet. OOM reaper is useful tool but it still cannot
> help in some cases (shared memory, a lot of metadata allocated on behalf
> of the process etc...).

I consider the OOM reaper as a useful tool for give up waiting for the OOM
victims after 1 second. Reclaiming memory is optional.

>                         Considering that the freezing can be an
> unprivileged operation (think cgroup freezer) then I am worried that
> one container can cause the global oom killer and hide oom victims to
> the fridge and spill over to other containers.

The OOM reaper will give up after 1 second. What is wrong with keeping
TIF_MEMDIE threads frozen? How does that differ from TIF_MEMDIE threads
being stuck at unkillable waits (e.g. i_mmap_lock_write()).

My understanding is that frozen threads are not holding locks. In this
aspect, frozen TIF_MEMDIE threads are less painful than TIF_MEMDIE threads
being stuck at unkillable waits.

>                                                Maybe I am overly
> paranoid and this scenario is not even all that interesting but I would
> like to hear a better justification which explains all these cases
> rather than "we have oom reaper so we are good to go" rationale.

I'm trying to simplify situations where oom_killer_disable() is called.
You are worrying about situations where oom_killer_disable() is not
called, aren't you?

  reply	other threads:[~2018-03-29 15:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 14:36 Tetsuo Handa
2018-03-29 14:50 ` Michal Hocko
2018-03-29 15:52   ` Tetsuo Handa [this message]
2018-03-30 15:16 ` kbuild test robot
2018-03-30 15:43 ` kbuild test robot
2018-03-30 15:44 ` kbuild test robot

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=201803300052.AHJ43293.HLVOtOFSQOFFJM@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mhocko@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    /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