Skip to content

Commit 4c6c002

Browse files
Kefeng Wangpalmer-dabbelt
authored andcommitted
riscv: mm: accelerate pagefault when badaccess
The access_error() of vma already checked under per-VMA lock, if it is a bad access, directly handle error, no need to retry with mmap_lock again. Since the page faut is handled under per-VMA lock, count it as a vma lock event with VMA_LOCK_SUCCESS. Reviewed-by: Suren Baghdasaryan <[email protected]> Signed-off-by: Kefeng Wang <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Tested-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 9850e73 commit 4c6c002

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/riscv/mm/fault.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ void handle_page_fault(struct pt_regs *regs)
293293
if (unlikely(access_error(cause, vma))) {
294294
vma_end_read(vma);
295295
count_vm_vma_lock_event(VMA_LOCK_SUCCESS);
296-
tsk->thread.bad_cause = cause;
297-
bad_area_nosemaphore(regs, SEGV_ACCERR, addr);
296+
tsk->thread.bad_cause = SEGV_ACCERR;
297+
bad_area_nosemaphore(regs, code, addr);
298298
return;
299299
}
300300

0 commit comments

Comments
 (0)