Skip to content

[PW_SID:1087860] mm: reduce mmap_lock contention and improve page fault performance#1845

Closed
linux-riscv-bot wants to merge 6 commits into
workflow__riscv__fixesfrom
pw1087860
Closed

[PW_SID:1087860] mm: reduce mmap_lock contention and improve page fault performance#1845
linux-riscv-bot wants to merge 6 commits into
workflow__riscv__fixesfrom
pw1087860

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1087860 applied to workflow__riscv__fixes

Name: mm: reduce mmap_lock contention and improve page fault performance
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1087860
Version: 2

Linux RISC-V bot and others added 6 commits April 30, 2026 05:50
If the current page fault is using the per-VMA lock, and we only released
the lock to wait for I/O completion (e.g., using folio_lock()), then when
the fault is retried after the I/O completes, it should still qualify for
the per-VMA-lock path.

Acked-by: Pedro Falcato <pfalcato@suse.de>
Tested-by: Wang Lian <wanglian@kylinos.cn>
Tested-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Wang Lian <lianux.mm@gmail.com>
Reviewed-by: Kunwu Chan <kunwu.chan@gmail.com>
Signed-off-by: Oven Liyang <liyangouwen1@oppo.com>
Co-developed-by: Barry Song <baohua@kernel.org>
Signed-off-by: Barry Song <baohua@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
If the current do_swap_page() took the per-VMA lock and we dropped it only
to wait for I/O completion (e.g., use folio_wait_locked()), then when
do_swap_page() is retried after the I/O completes, it should still qualify
for the per-VMA-lock path.

Tested-by: Wang Lian <wanglian@kylinos.cn>
Tested-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Wang Lian <lianux.mm@gmail.com>
Reviewed-by: Kunwu Chan <kunwu.chan@gmail.com>
Signed-off-by: Barry Song (Xiaomi) <baohua@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
folio_lock_or_retry() is effectively only used in mm/memory.c,
not in the filemap code. Move it there and make it static.

The helper __folio_lock_or_retry() can be folded into
folio_lock_or_retry(), allowing it to be removed.

Signed-off-by: Barry Song (Xiaomi) <baohua@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
If we are waiting for long I/O to complete, it makes sense to
avoid holding locks for too long. However, if the folio is
uptodate, we are likely only waiting for a concurrent PTE
update to finish. Retrying the entire page fault seems
excessive.

Signed-off-by: Barry Song (Xiaomi) <baohua@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…faults

For uptodate folios, we are not waiting on I/O. We should
be able to acquire the folio lock shortly, so there is no
need to drop per-vma locks and perform a full PF retry.

Signed-off-by: Barry Song (Xiaomi) <baohua@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 140.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 2208.77 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 3046.59 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.08 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.04 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.59 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 87.97 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
kdoc
Desc: Detects for kdoc errors
Duration: 1.97 seconds
Result: ERROR
Output:

Checking the tree before the patch
Checking the tree with the patch
Warning: include/linux/mm_types.h:1686 Enum value 'VM_FAULT_RETRY_VMA' not described in enum 'vm_fault_reason'
Warning: include/linux/mm_types.h:1686 Enum value 'VM_FAULT_RETRY_VMA' not described in enum 'vm_fault_reason'
Errors and warnings before: 0 this patch: 2
New warnings added
0a1,2
> Warning: include/linux/mm_types.h:1686 Enum value 'VM_FAULT_RETRY_VMA' not described in enum 'vm_fault_reason'
> Warning: include/linux/mm_types.h:1686 Enum value 'VM_FAULT_RETRY_VMA' not described in enum 'vm_fault_reason'
Per-file breakdown


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
module-param
Desc: Detect module_param changes
Duration: 0.40 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.79 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/5] mm/filemap: Retry fault by VMA lock if the lock was released for I/O"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.47 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 141.07 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1141.47 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1707.96 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.00 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.11 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.84 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 86.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
kdoc
Desc: Detects for kdoc errors
Duration: 0.96 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
module-param
Desc: Detect module_param changes
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/5] mm/swapin: Retry swapin by VMA lock if the lock was released for I/O"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.33 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/5] mm: Move folio_lock_or_retry() and drop __folio_lock_or_retry()"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/5] mm: Move folio_lock_or_retry() and drop __folio_lock_or_retry()"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.33 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 139.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1135.84 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1691.73 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.03 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.40 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.80 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 86.74 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
kdoc
Desc: Detects for kdoc errors
Duration: 0.95 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/5] mm: Don't retry page fault if folio is uptodate during swap-in"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.33 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 140.45 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1138.20 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1697.02 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.80 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 26.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.80 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 88.11 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
kdoc
Desc: Detects for kdoc errors
Duration: 0.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
module-param
Desc: Detect module_param changes
Duration: 0.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v2,5/5] mm/filemap: Avoid retrying page faults on uptodate folios in filemap faults"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow__riscv__fixes branch 2 times, most recently from f190ec6 to 2c3b264 Compare May 2, 2026 08:13
@linux-riscv-bot linux-riscv-bot deleted the pw1087860 branch May 8, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant