Patch "riscv/vdso: make arch_setup_additional_pages wait for mmap_sem for write killable" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    riscv/vdso: make arch_setup_additional_pages wait for mmap_sem for write killable

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     riscv-vdso-make-arch_setup_additional_pages-wait-for.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 211887c97a451e6f931613cf67b6698d25c2f346
Author: Tong Tiangen <tongtiangen@xxxxxxxxxx>
Date:   Wed Sep 1 02:46:21 2021 +0000

    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@xxxxxxxxxx>
    Reviewed-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
    Fixes: 76d2a0493a17 ("RISC-V: Init and Halt Code")
    Signed-off-by: Palmer Dabbelt <palmerdabbelt@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c
index 3f1d35e7c98a..73d45931a053 100644
--- a/arch/riscv/kernel/vdso.c
+++ b/arch/riscv/kernel/vdso.c
@@ -65,7 +65,9 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
 
 	vdso_len = (vdso_pages + 1) << PAGE_SHIFT;
 
-	mmap_write_lock(mm);
+	if (mmap_write_lock_killable(mm))
+		return -EINTR;
+
 	vdso_base = get_unmapped_area(NULL, 0, vdso_len, 0, 0);
 	if (IS_ERR_VALUE(vdso_base)) {
 		ret = vdso_base;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux