The patch titled Subject: mm: return faster for non-fatal signals in user mode faults has been removed from the -mm tree. Its filename was mm-return-faster-for-non-fatal-signals-in-user-mode-faults.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Peter Xu <peterx@xxxxxxxxxx> Subject: mm: return faster for non-fatal signals in user mode faults The idea comes from the upstream discussion between Linus and Andrea: https://lore.kernel.org/lkml/20171102193644.GB22686@xxxxxxxxxx/ A summary to the issue: there was a special path in handle_userfault() in the past that we'll return a VM_FAULT_NOPAGE when we detected non-fatal signals when waiting for userfault handling. We did that by reacquiring the mmap_sem before returning. However that brings a risk in that the vmas might have changed when we retake the mmap_sem and even we could be holding an invalid vma structure. This patch is a preparation of removing that special path by allowing the page fault to return even faster if we were interrupted by a non-fatal signal during a user-mode page fault handling routine. Link: http://lkml.kernel.org/r/20200220160230.9598-1-peterx@xxxxxxxxxx Signed-off-by: Peter Xu <peterx@xxxxxxxxxx> Suggested-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Suggested-by: Andrea Arcangeli <aarcange@xxxxxxxxxx> Tested-by: Brian Geffon <bgeffon@xxxxxxxxxx> Cc: Bobby Powers <bobbypowers@xxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Denis Plotnikov <dplotnikov@xxxxxxxxxxxxx> Cc: "Dr . David Alan Gilbert" <dgilbert@xxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Jerome Glisse <jglisse@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: "Kirill A . Shutemov" <kirill@xxxxxxxxxxxxx> Cc: Martin Cracauer <cracauer@xxxxxxxx> Cc: Marty McFadden <mcfadden8@xxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Maya Gokhale <gokhale2@xxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Cc: Mike Rapoport <rppt@xxxxxxxxxxxxxxxxxx> Cc: Pavel Emelyanov <xemul@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/sched/signal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/include/linux/sched/signal.h~mm-return-faster-for-non-fatal-signals-in-user-mode-faults +++ a/include/linux/sched/signal.h @@ -381,7 +381,8 @@ static inline bool fault_signal_pending( struct pt_regs *regs) { return unlikely((fault_flags & VM_FAULT_RETRY) && - fatal_signal_pending(current)); + (fatal_signal_pending(current) || + (user_mode(regs) && signal_pending(current)))); } /* _ Patches currently in -mm which might be from peterx@xxxxxxxxxx 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