Re: [patch v2] mm, oom: fix concurrent munlock and oom reaper unmap

From: David Rientjes
Date: Tue Apr 24 2018 - 18:26:01 EST


On Wed, 25 Apr 2018, Tetsuo Handa wrote:

> > One of the reasons that I extracted __oom_reap_task_mm() out of the new
> > oom_reap_task_mm() is to avoid the checks that would be unnecessary when
> > called from exit_mmap(). In this case, we can ignore the
> > mm_has_blockable_invalidate_notifiers() check because exit_mmap() has
> > already done mmu_notifier_release(). So I don't think there's a concern
> > about __oom_reap_task_mm() blocking while holding oom_lock. Unless you
> > are referring to something else?
>
> Oh, mmu_notifier_release() made mm_has_blockable_invalidate_notifiers() == false. OK.
>
> But I want comments why it is safe; I will probably miss that dependency
> when we move that code next time.
>

Ok, makes sense. I'll send a v3 to update the comment.