Skip to contentSkip to conversation

LoongArch: mm: try VMA lock-based page fault handling first

PATCH Superseded Wentao Guan 1 participant 1 message Sep 28, 2025 LoongArch

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 LoongArch: mm: try VMA lock-based page fault handling first

Attempt VMA lock-based page fault handling first, and fall back to the existing mmap_lock-based handling if that fails.

The "ebizzy -mTRp" on 3A6000 shows that PER_VMA_LOCK can improve the benchmark by about 17.9%(97837.7 to 115430.8).

This is the loongarch variant of "x86/mm: try VMA lock-based page fault handling first".

Let us discuss the four fault cases after handle_mm_fault 1.fault_signal_pending(fault, regs):
handle before goto done.
2.fault & VM_FAULT_COMPLETED:
fallthrough to return.
3.fault & VM_FAULT_RETRY:
handle before goto done.
4.fault & VM_FAULT_ERROR:
reuse the origin way to handle.

---
v2 changelog:
1. fix bug when VM_FAULT_ERROR and miss some count_vm_vma_lock_event
2. update test result.
ebizzy-0.3(can download by phoronix-test-suite):
before patch:
97800 records/s
real 10.00 s user 0.25 s sys 13.54 s
97835 records/s
real 10.00 s user 0.27 s sys 13.51 s
97929 records/s
real 10.00 s user 0.26 s sys 13.53 s
97736 records/s
real 10.00 s user 0.31 s sys 13.48 s
97914 records/s
real 10.00 s user 0.30 s sys 13.50 s
97916 records/s
real 10.00 s user 0.31 s sys 13.48 s
97857 records/s
real 10.00 s user 0.28 s sys 13.51 s
97927 records/s
real 10.00 s user 0.24 s sys 13.55 s
97962 records/s
real 10.00 s user 0.41 s sys 13.39 s
97501 records/s
real 10.00 s user 0.20 s sys 13.53 s
after patch:
117938 records/s
real 10.00 s user 0.40 s sys 23.48 s
116762 records/s
real 10.00 s user 0.39 s sys 23.20 s
116412 records/s
real 10.00 s user 0.37 s sys 23.22 s
116047 records/s
real 10.00 s user 0.45 s sys 23.04 s
116324 records/s
real 10.00 s user 0.45 s sys 23.08 s
115854 records/s
real 10.00 s user 0.33 s sys 23.17 s
116350 records/s
real 10.00 s user 0.38 s sys 23.15 s
116040 records/s
real 10.00 s user 0.34 s sys 23.16 s
116021 records/s
real 10.00 s user 0.36 s sys 23.10 s
116560 records/s
real 10.00 s user 0.37 s sys 23.23 s
---

---
 arch/loongarch/Kconfig    |  1 +
 arch/loongarch/mm/fault.c | 55 ++++++++++++++++++++++++++++++++++++---
 2 files changed, 53 insertions(+), 3 deletions(-)
arch/loongarch/Kconfig +1 -0
index 0631a6b11281b..1c517954157c0 100644
@@ -69,6 +69,7 @@ config LOONGARCH
 	select ARCH_SUPPORTS_LTO_CLANG_THIN
 	select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
 	select ARCH_SUPPORTS_NUMA_BALANCING
+	select ARCH_SUPPORTS_PER_VMA_LOCK
 	select ARCH_SUPPORTS_RT
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_CMPXCHG_LOCKREF
arch/loongarch/mm/fault.c +52 -3

74 lines not on this page · raw message

Signature · 1 line
2.20.1