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: mgorman@suse.de, rientjes@google.com,
	torvalds@linux-foundation.org, oleg@redhat.com, hughd@google.com,
	andrea@kernel.org, riel@redhat.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, penguin-kernel@I-love.SAKURA.ne.jp
Subject: Re: [PATCH] mm,oom: Always sleep before retrying.
Date: Fri, 1 Jan 2016 16:54:41 +0900	[thread overview]
Message-ID: <201601011654.IFC09303.MOLOFFVOQtHSFJ@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <201512301101.GJD12974.LOVFFtFMOHOJSQ@I-love.SAKURA.ne.jp>

Tetsuo Handa wrote:
> When we entered into "Reclaim has failed us, start killing things"
> state, sleep function is called only when mutex_trylock(&oom_lock)
> in __alloc_pages_may_oom() failed or immediately after returning from
> oom_kill_process() in out_of_memory(). This may be insufficient for
> giving other tasks a chance to run because mutex_trylock(&oom_lock)
> will not fail under non-preemptive UP kernel.

My misunderstanding. I thought cond_resched() is a no-op under
non-preemptive UP kernel.

Calling schedule_timeout_uninterruptible(1) will allow other pending
workqueue items a chance to run if current thread is kworker thread.
But if current thread is one of threads which the OOM victim depends
on, calling it merely delays termination of the OOM victim. Therefore,
nobody can judge whether calling it will help the OOM victim and its
dependent threads to make use of CPU cycles for making progress.
Although always sleeping helps saving CPU cycles under OOM livelock,
we need to give up waiting for the OOM victim at some point (i.e.
trigger kernel panic like panic_on_oom_timeout or choose subsequent
OOM victims).

--
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:[~2016-01-01  7:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30  2:01 Tetsuo Handa
2016-01-01  7:54 ` Tetsuo Handa [this message]

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=201601011654.IFC09303.MOLOFFVOQtHSFJ@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=andrea@kernel.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@kernel.org \
    --cc=oleg@redhat.com \
    --cc=riel@redhat.com \
    --cc=rientjes@google.com \
    --cc=torvalds@linux-foundation.org \
    /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