Skip to content

Commit b502f03

Browse files
xzpetertorvalds
authored andcommitted
arm64/mm: use helper fault_signal_pending()
Let the arm64 fault handling to use the new fault_signal_pending() helper, by moving the signal handling out of the retry logic. Signed-off-by: Peter Xu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Tested-by: Brian Geffon <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Bobby Powers <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Denis Plotnikov <[email protected]> Cc: "Dr . David Alan Gilbert" <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Jerome Glisse <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: "Kirill A . Shutemov" <[email protected]> Cc: Martin Cracauer <[email protected]> Cc: Marty McFadden <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Maya Gokhale <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Pavel Emelyanov <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 24a62cf commit b502f03

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

arch/arm64/mm/fault.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -513,19 +513,14 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
513513
fault = __do_page_fault(mm, addr, mm_flags, vm_flags);
514514
major |= fault & VM_FAULT_MAJOR;
515515

516-
if (fault & VM_FAULT_RETRY) {
517-
/*
518-
* If we need to retry but a fatal signal is pending,
519-
* handle the signal first. We do not need to release
520-
* the mmap_sem because it would already be released
521-
* in __lock_page_or_retry in mm/filemap.c.
522-
*/
523-
if (fatal_signal_pending(current)) {
524-
if (!user_mode(regs))
525-
goto no_context;
526-
return 0;
527-
}
516+
/* Quick path to respond to signals */
517+
if (fault_signal_pending(fault, regs)) {
518+
if (!user_mode(regs))
519+
goto no_context;
520+
return 0;
521+
}
528522

523+
if (fault & VM_FAULT_RETRY) {
529524
/*
530525
* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk of
531526
* starvation.

0 commit comments

Comments
 (0)