Re: [PATCH] vmalloc: back off only when the current task is OOM killed

From: Johannes Weiner
Date: Tue Oct 10 2017 - 08:48:06 EST


On Tue, Oct 10, 2017 at 07:58:53PM +0900, Tetsuo Handa wrote:
> Commit 5d17a73a2ebeb8d1 ("vmalloc: back off when the current task is
> killed") revealed two bugs [1] [2] that were not ready to fail vmalloc()
> upon SIGKILL. But since the intent of that commit was to avoid unlimited
> access to memory reserves, we should have checked tsk_is_oom_victim()
> rather than fatal_signal_pending().
>
> Note that even with commit cd04ae1e2dc8e365 ("mm, oom: do not rely on
> TIF_MEMDIE for memory reserves access"), it is possible to trigger
> "complete depletion of memory reserves" and "extra OOM kills due to
> depletion of memory reserves" by doing a large vmalloc() request if commit
> 5d17a73a2ebeb8d1 is reverted. Thus, let's keep checking tsk_is_oom_victim()
> rather than removing fatal_signal_pending().

Nothing has changed since the last time you proposed this.

Who is doing large vmallocs, and why shouldn't we annotate what's
special instead of littering generic code with checks for unlikely
events?