lkml.org 
[lkml]   [2016]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mm,oom: Always sleep before retrying.
From
Date
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).


\
 
 \ /
  Last update: 2016-01-01 09:41    [W:0.024 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site