Commit 43632871 authored by Pekka Enberg's avatar Pekka Enberg Committed by Palmer Dabbelt

riscv/mm: Simplify retry logic in do_page_fault()

Let's combine the two retry logic if statements in do_page_fault() to
simplify the code.
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent d012a719
...@@ -127,8 +127,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs) ...@@ -127,8 +127,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
BUG(); BUG();
} }
if (flags & FAULT_FLAG_ALLOW_RETRY) { if (unlikely((fault & VM_FAULT_RETRY) && (flags & FAULT_FLAG_ALLOW_RETRY))) {
if (fault & VM_FAULT_RETRY) {
flags |= FAULT_FLAG_TRIED; flags |= FAULT_FLAG_TRIED;
/* /*
...@@ -138,7 +137,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs) ...@@ -138,7 +137,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
*/ */
goto retry; goto retry;
} }
}
mmap_read_unlock(mm); mmap_read_unlock(mm);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment