mm-gup-allow-to-react-to-fatal-signals.patch removed from -mm tree
The patch titled
Subject: mm/gup: allow to react to fatal signals
has been removed from the -mm tree. Its filename was
mm-gup-allow-to-react-to-fatal-signals.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Peter Xu <[email protected]>
Subject: mm/gup: allow to react to fatal signals
The existing gup code does not react to the fatal signals in many code paths. For example, in one retry path of gup we're still using down_read() rather than down_read_killable(). Also, when doing page faults we don't pass in FAULT_FLAG_KILLABLE as well, which means that within the faulting process we'll wait in non-killable way as well. These were spotted by Linus during the code review of some other patches.
Let's allow the gup code to react to fatal signals to improve the responsiveness of threads when during gup and being killed.
---
mm/gup.c | 12 +++++++++--- mm/hugetlb.c | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-)
mm/gup.c renamed from mm/gup.c~mm-gup-allow-to-react-to-fatal-signals +9 -3
@@ -864,7 +864,7 @@ static int faultin_page(struct task_struif (*flags &FOLL_REMOTE ) fault_flags |=FAULT_FLAG_REMOTE ;if (locked) - fault_flags |=FAULT_FLAG_ALLOW_RETRY ; + fault_flags |=FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ;if (*flags &FOLL_NOWAIT ) fault_flags |=FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_RETRY_NOWAIT ;if (*flags &FOLL_TRIED ) {
@@ -1207,7 +1207,7 @@ int fixup_user_fault(struct task_struct address =untagged_addr (address);if (unlocked) - fault_flags |=FAULT_FLAG_ALLOW_RETRY ; + fault_flags |=FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; retry: vma =find_extend_vma (mm, address);
@@ -1329,7 +1329,13 @@ retry:break ; *locked =1 ; -down_read (&mm->mmap_sem); + ret =down_read_killable (&mm->mmap_sem); +if (ret) { +BUG_ON (ret >0 ); +if (!pages_done) + pages_done = ret; +break ; + } ret =__get_user_pages (tsk, mm, start,1 , flags |FOLL_TRIED , pages,NULL , locked);
mm/hugetlb.c renamed from mm/hugetlb.c~mm-gup-allow-to-react-to-fatal-signals +2 -1
@@ -4344,7 +4344,8 @@ long follow_hugetlb_page(struct mm_strucif (flags &FOLL_WRITE ) fault_flags |=FAULT_FLAG_WRITE ;if (locked) - fault_flags |=FAULT_FLAG_ALLOW_RETRY ; + fault_flags |=FAULT_FLAG_ALLOW_RETRY | +FAULT_FLAG_KILLABLE ;if (flags &FOLL_NOWAIT ) fault_flags |=FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_RETRY_NOWAIT ;
_
Patches currently in -mm which might be from [email protected] are
mm-merge-parameters-for-change_protection.patch userfaultfd-wp-apply-_page_uffd_wp-bit.patch userfaultfd-wp-drop-_page_uffd_wp-properly-when-fork.patch userfaultfd-wp-add-pmd_swp_uffd_wp-helpers.patch userfaultfd-wp-support-swap-and-page-migration.patch khugepaged-skip-collapse-if-uffd-wp-detected.patch userfaultfd-wp-dont-wake-up-when-doing-write-protect.patch userfaultfd-wp-declare-_uffdio_writeprotect-conditionally.patch userfaultfd-selftests-refactor-statistics.patch userfaultfd-selftests-add-write-protect-test.patch