mm, oom: remove oom_lock from oom_reaper
oom_reaper used to rely on the oom_lock since e2fe1456 ("oom_reaper: close race with exiting task"). We do not really need the lock anymore though. 21292580 ("mm: oom: let oom_reap_task and exit_mmap run concurrently") has removed serialization with the exit path based on the mm reference count and so we do not really rely on the oom_lock anymore. Tetsuo was arguing that at least MMF_OOM_SKIP should be set under the lock to prevent from races when the page allocator didn't manage to get the freed (reaped) memory in __alloc_pages_may_oom but it sees the flag later on and move on to another victim. Although this is possible in principle let's wait for it to actually happen in real life before we make the locking more complex again. Therefore remove the oom_lock for oom_reaper paths (both exit_mmap and oom_reap_task_mm). The reaper serializes with exit_mmap by mmap_sem + MMF_OOM_SKIP flag. There is no synchronization with out_of_memory path now. Change-Id: Ifca2e3b07d4382e7a4c535306a83fbde6640ba1c Link: https://patchwork.kernel.org/patch/10533755/ Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Git-commit: af5679fbc669f31f7ebd0d473bca76c24c07de30 Suggested-by:David Rientjes <rientjes@google.com> Signed-off-by:
Michal Hocko <mhocko@suse.com> Acked-by:
David Rientjes <rientjes@google.com> Signed-off-by:
Charan Teja Reddy <charante@codeaurora.org>
Loading
Please register or sign in to comment