riscv/vdso: make arch_setup_additional_pages wait for mmap_sem for write killable
authorTong Tiangen <tongtiangen@huawei.com>
Wed, 1 Sep 2021 02:46:21 +0000 (02:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Oct 2021 08:04:29 +0000 (10:04 +0200)
commit2c152d9da8fed3cade515eb5249fab805c87d831
tree0c330cda70cbbb2479c8f3aa20399b590d5a0897
parentde834e12b96d90d7edd1374c9b12a62baa8cdb9b
riscv/vdso: make arch_setup_additional_pages wait for mmap_sem for write killable

[ Upstream commit 8bb0ab3ae7a4dbe6cf32deb830cf2bdbf5736867 ]

riscv architectures 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: Tong Tiangen <tongtiangen@huawei.com>
Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Fixes: 76d2a0493a17 ("RISC-V: Init and Halt Code")
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/kernel/vdso.c