Re: [PATCH v3] mm: use per_vma lock for MADV_DONTNEED
From: Barry Song
Date: Sat Jun 07 2025 - 05:34:43 EST
>
> Whoops, I should add R-b only applies with the fix-patch proposed in [0].
>
> [0]: https://lore.kernel.org/all/CAGsJ_4x1RbQ+GKKc1rrTaNA8Xd+W8K-Zu6-kwVYNKzB0OWiowQ@xxxxxxxxxxxxxx/
>
> Barry - Probably worth respinning a v4 to pick that up to make things
> clear, you can propagate my tag with that.
Sure. It's a small, non-functional change:
diff --git a/mm/madvise.c b/mm/madvise.c
index a94e6a7ee387..8382614b71d1 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -1534,8 +1534,7 @@ int madvise_walk_vmas(struct mm_struct *mm, unsigned long start,
if (madv_behavior && madv_behavior->lock_mode == MADVISE_VMA_READ_LOCK) {
vma = try_vma_read_lock(mm, madv_behavior, start, end);
if (vma) {
- error = madvise_vma_behavior(vma, &prev, start, end,
- madv_behavior);
+ error = visit(vma, &prev, start, end, arg);
vma_end_read(vma);
return error;
}
>
> Cheers, Lorenzo
Thanks
Barry