]> git.baikalelectronics.ru Git - kernel.git/commit
exec: make exec path waiting for mmap_sem killable
authorMichal Hocko <mhocko@suse.com>
Mon, 23 May 2016 23:26:02 +0000 (16:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 May 2016 00:04:14 +0000 (17:04 -0700)
commit97783c00cb981bbc9f2dcf1b4ef19f11d589af20
treefe801df15a0b82af4ac665bfa92db7804c06f9b5
parent0e55fdd925c43297e46e4d3e2eefb0180edc66d0
exec: make exec path waiting for mmap_sem killable

setup_arg_pages requires mmap_sem for write.  If the waiting task gets
killed by the oom killer 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.  All the callers are already handling error
path and the fatal signal doesn't need any additional treatment.

The same applies to __bprm_mm_init.

Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/exec.c