linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: rientjes@google.com, hannes@cmpxchg.org
Cc: akpm@linux-foundation.org, mhocko@suse.cz, aarcange@redhat.com,
	david@fromorbit.com, vbabka@suse.cz, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/9] mm: oom_kill: simplify OOM killer locking
Date: Wed, 29 Apr 2015 14:48:21 +0900	[thread overview]
Message-ID: <201504291448.GDH51070.OOOFMFVHLStQFJ@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <alpine.DEB.2.10.1504281540280.10203@chino.kir.corp.google.com>

David Rientjes wrote:
> It's not vital and somewhat unrelated to your patch, but if we can't grab 
> the mutex with the trylock in __alloc_pages_may_oom() then I think it 
> would be more correct to do schedule_timeout_killable() rather than 
> uninterruptible.  I just mention it if you happen to go through another 
> revision of the series and want to switch it at the same time.

It is a difficult choice. Killable sleep is a good thing if

  (1) the OOM victim is current thread
  (2) the OOM victim is waiting for current thread to release lock

but is a bad thing otherwise. And currently, (2) is not true because current
thread cannot access the memory reserves when current thread is blocking the
OOM victim. If fatal_signal_pending() threads can access portion of the memory
reserves (like I said

  I don't like allowing only TIF_MEMDIE to get reserve access, for it can be
  one of !TIF_MEMDIE threads which really need memory to safely terminate without
  failing allocations from do_exit(). Rather, why not to discontinue TIF_MEMDIE
  handling and allow getting access to private memory reserves for all
  fatal_signal_pending() threads (i.e. replacing WMARK_OOM with WMARK_KILLED
  in "[patch 09/12] mm: page_alloc: private memory reserves for OOM-killing
  allocations") ?

at https://lkml.org/lkml/2015/3/27/378 ), (2) will become true.

Of course, the threads which the OOM victim is waiting for may not have
SIGKILL pending. WMARK_KILLED helps if the lock contention is happening
among threads sharing the same mm struct, does not help otherwise.

Well, what about introducing WMARK_OOM as a memory reserve which can be
accessed during atomic_read(&oom_victims) > 0? In this way, we can choose
next OOM victim upon reaching WMARK_OOM.

--
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:[~2015-04-29  6:23 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 [this message]
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
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=201504291448.GDH51070.OOOFMFVHLStQFJ@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