Skip to content

Commit c9a0dad

Browse files
xzpetertorvalds
authored andcommitted
powerpc/mm: use helper fault_signal_pending()
Let powerpc code to use the new helper, by moving the signal handling earlier before 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 b502f03 commit c9a0dad

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

arch/powerpc/mm/fault.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,9 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
582582

583583
major |= fault & VM_FAULT_MAJOR;
584584

585+
if (fault_signal_pending(fault, regs))
586+
return user_mode(regs) ? 0 : SIGBUS;
587+
585588
/*
586589
* Handle the retry right now, the mmap_sem has been released in that
587590
* case.
@@ -595,15 +598,8 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
595598
*/
596599
flags &= ~FAULT_FLAG_ALLOW_RETRY;
597600
flags |= FAULT_FLAG_TRIED;
598-
if (!fatal_signal_pending(current))
599-
goto retry;
601+
goto retry;
600602
}
601-
602-
/*
603-
* User mode? Just return to handle the fatal exception otherwise
604-
* return to bad_page_fault
605-
*/
606-
return is_user ? 0 : SIGBUS;
607603
}
608604

609605
up_read(&current->mm->mmap_sem);

0 commit comments

Comments
 (0)