Skip to content

[PW_SID:976439] [1/1] mm/rmap: make folio unmap batching safe and support partial batches#582

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw976439
Closed

[PW_SID:976439] [1/1] mm/rmap: make folio unmap batching safe and support partial batches#582
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw976439

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 976439 applied to workflow__riscv__fixes

Name: [1/1] mm/rmap: make folio unmap batching safe and support partial batches
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=976439
Version: 1

Linux RISC-V bot and others added 2 commits June 24, 2025 01:05
As pointed out by David[1], the batched unmap logic in try_to_unmap_one()
can read past the end of a PTE table if a large folio is mapped starting at
the last entry of that table.

So let's fix the out-of-bounds read by refactoring the logic into a new
helper, folio_unmap_pte_batch().

The new helper now correctly calculates the safe number of pages to scan by
limiting the operation to the boundaries of the current VMA and the PTE
table.

In addition, the "all-or-nothing" batching restriction is removed to
support partial batches. The reference counting is also cleaned up to use
folio_put_refs().

[1] https://lore.kernel.org/linux-mm/a694398c-9f03-4737-81b9-7e49c857fcbe@redhat.com

Fixes: 354dffd ("mm: support batched unmap for lazyfree large folios during reclamation")
Suggested-by: David Hildenbrand <david@redhat.com>
Suggested-by: Barry Song <baohua@kernel.org>
Signed-off-by: Lance Yang <lance.yang@linux.dev>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 103.56 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1017.00 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1518.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.99 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.85 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.68 seconds
Result: WARNING
Output:

CHECK: Alignment should match open parenthesis
#45: FILE: mm/rmap.c:1849:
+static inline unsigned int folio_unmap_pte_batch(struct folio *folio,
+			struct page_vma_mapped_walk *pvmw,

total: 0 errors, 0 warnings, 1 checks, 73 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 1daa938e4332 ("mm/rmap: make folio unmap batching safe and support partial batches") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 1 checks, 73 lines checked
CHECK: Alignment should match open parenthesis


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 71.72 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/1] mm/rmap: make folio unmap batching safe and support partial batches"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow__riscv__fixes branch 2 times, most recently from a7cb30d to d776861 Compare July 2, 2025 18:46
@linux-riscv-bot linux-riscv-bot deleted the pw976439 branch July 5, 2025 01:04
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.

2 participants