Re: [PATCH] mm, proc: make clear_refs killable

From: Vlastimil Babka
Date: Fri Mar 11 2016 - 05:59:52 EST


On 02/29/2016 06:56 PM, Michal Hocko wrote:
From: Michal Hocko <mhocko@xxxxxxxx>

CLEAR_REFS_MM_HIWATER_RSS and CLEAR_REFS_SOFT_DIRTY are relying on
mmap_sem for write. If the waiting task gets killed by the oom killer
and it would operate on the current's mm it would block oom_reaper from
asynchronous address space reclaim and reduce the chances of timely OOM
resolving. Wait for the lock in the killable mode and return with EINTR
if the task got killed while waiting. This will also expedite the return
to the userspace and do_exit even if the mm is remote.

Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
Cc: Petr Cermak <petrcermak@xxxxxxxxxxxx>
Signed-off-by: Michal Hocko <mhocko@xxxxxxxx>

Acked-by: Vlastimil Babka <vbabka@xxxxxxx>