Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1299852

Re: [PATCH] mm,oom: Always sleep before retrying.

From Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Newsgroups linux.kernel
Subject Re: [PATCH] mm,oom: Always sleep before retrying.
Date 2016-01-01 09:00 +0100
Message-ID <qM2MW-7kN-1@gated-at.bofh.it> (permalink)
References <qLen7-g3-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] mm,oom: Always sleep before retrying. Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-12-30 03:10 +0100
  Re: [PATCH] mm,oom: Always sleep before retrying. Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-01-01 09:00 +0100

csiph-web