Re: [patch] mm, oom: prevent additional oom kills before memory is freed

From: Tetsuo Handa
Date: Fri Jun 16 2017 - 00:00:35 EST


Tetsuo Handa wrote:
> and clarify in your patch that there is no possibility
> of waiting for direct/indirect memory allocation inside free_pgtables(),
> in addition to fixing the bug above.

Oops, this part was wrong, for __oom_reap_task_mm() will give up after
waiting for one second because down_read_trylock(&mm->mmap_sem) continues
failing due to down_write(&mm->mmap_sem) by exit_mmap().
# This is after all moving the location of "give up by timeout", isn't it? ;-)

Thus, clarify in your patch that there is no possibility of waiting for
direct/indirect memory allocation outside down_write()/up_write() (e.g.
i_mmap_lock_write() inside unmap_vmas(&tlb, vma, 0, -1) just before
down_write()).