Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/damon/vaddr: remove redundant RCU lock
@ 2026-06-29 16:53 IgorpetinDev
  2026-06-30  1:00 ` SJ Park
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: IgorpetinDev @ 2026-06-29 16:53 UTC (permalink / raw)
  To: sj, akpm; +Cc: damon, linux-mm, linux-kernel, IgorpetinDev

__damon_va_three_regions() is called only by damon_va_three_regions(),
which already holds mmap_read_lock(). Since mmap_read_lock() is held,
the maple tree and VMA list are protected from concurrent changes.
Remove the unnecessary rcu_read_lock() and rcu_read_unlock() calls.

Signed-off-by: IgorpetinDev <igorpetindev@gmail.com>
---
 mm/damon/vaddr.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
index d27147603..345b89b5d 100644
--- a/mm/damon/vaddr.c
+++ b/mm/damon/vaddr.c
@@ -84,7 +84,6 @@ static int __damon_va_three_regions(struct mm_struct *mm,
 	 * If this is too slow, it can be optimised to examine the maple
 	 * tree gaps.
 	 */
-	rcu_read_lock();
 	for_each_vma(vmi, vma) {
 		unsigned long gap;
 
@@ -105,7 +104,6 @@ static int __damon_va_three_regions(struct mm_struct *mm,
 next:
 		prev = vma;
 	}
-	rcu_read_unlock();
 
 	if (!sz_range(&second_gap) || !sz_range(&first_gap))
 		return -EINVAL;
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-06-30 14:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-29 16:53 [PATCH] mm/damon/vaddr: remove redundant RCU lock IgorpetinDev
2026-06-30  1:00 ` SJ Park
2026-06-30 12:50   ` IgorpetinDev
2026-06-30 13:01 ` Igor Putko
2026-06-30 13:02 ` [PATCH v2] " Igor Putko
2026-06-30 14:03   ` SJ Park
2026-06-30 13:07 ` [PATCH] " Igor Putko
2026-06-30 13:54   ` SJ Park
2026-06-30 14:25 ` Igor Putko
2026-06-30 14:50   ` SJ Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox