Skip to content

Commit fb027ad

Browse files
xzpetertorvalds
authored andcommitted
sh/mm: use helper fault_signal_pending()
Let SH to use the new fault_signal_pending() helper. Here we'll need to move the up_read() out because that's actually needed as long as !RETRY cases. At the meantime we can drop all the rest of up_read()s now (which seems to be cleaner). 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 c9a0dad commit fb027ad

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/sh/mm/fault.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,25 +302,25 @@ mm_fault_error(struct pt_regs *regs, unsigned long error_code,
302302
* Pagefault was interrupted by SIGKILL. We have no reason to
303303
* continue pagefault.
304304
*/
305-
if (fatal_signal_pending(current)) {
306-
if (!(fault & VM_FAULT_RETRY))
307-
up_read(&current->mm->mmap_sem);
305+
if (fault_signal_pending(fault, regs)) {
308306
if (!user_mode(regs))
309307
no_context(regs, error_code, address);
310308
return 1;
311309
}
312310

311+
/* Release mmap_sem first if necessary */
312+
if (!(fault & VM_FAULT_RETRY))
313+
up_read(&current->mm->mmap_sem);
314+
313315
if (!(fault & VM_FAULT_ERROR))
314316
return 0;
315317

316318
if (fault & VM_FAULT_OOM) {
317319
/* Kernel mode? Handle exceptions or die: */
318320
if (!user_mode(regs)) {
319-
up_read(&current->mm->mmap_sem);
320321
no_context(regs, error_code, address);
321322
return 1;
322323
}
323-
up_read(&current->mm->mmap_sem);
324324

325325
/*
326326
* We ran out of memory, call the OOM killer, and return the

0 commit comments

Comments
 (0)