mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
vdso: make arch_setup_additional_pages wait for mmap_sem for write killable
most architectures are relying on mmap_sem for write in their arch_setup_additional_pages. 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. Signed-off-by: Michal Hocko <[email protected]> Acked-by: Andy Lutomirski <[email protected]> [x86 vdso] Acked-by: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
91f4f94ea3
commit
6904817607
9 changed files with 21 additions and 10 deletions
|
|
@ -65,7 +65,8 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
|
|||
unsigned long vdso_base;
|
||||
struct mm_struct *mm = current->mm;
|
||||
|
||||
down_write(&mm->mmap_sem);
|
||||
if (down_write_killable(&mm->mmap_sem))
|
||||
return -EINTR;
|
||||
|
||||
/* Try to get it loaded right near ld.so/glibc. */
|
||||
vdso_base = STACK_TOP;
|
||||
|
|
|
|||
Loading…
Reference in a new issue