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@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>