The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2] mm/rmap: synchronize lock and unlock target in anon_vma_clone
@ 2026-08-17  2:34 Eric Kim
  2026-08-17  2:37 ` Rik van Riel
  2026-08-17  3:07 ` Lance Yang
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Kim @ 2026-08-17  2:34 UTC (permalink / raw)
  To: akpm
  Cc: david, ljs, riel, liam, vbabka, harry, jannh, lance.yang,
	linux-mm, linux-kernel, Eric Kim

Currently, in anon_vma_clone(), active_anon_vma is assigned from
src->anon_vma and is used when unlocking anon_vma after linking
new AVCs. However, the corresponding lock operation uses
src->anon_vma directly.

Use active_anon_vma consistently to make the lock/unlock pair explicit.

Signed-off-by: Eric Kim <seohyun.kim@outlook.kr>
---
v2:
- Clarify the commit message to explain that src->anon_vma and
  active_anon_vma refer to the same anon_vma.

mm/rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 1c77d5dc06e9..f3fadfb69c7f 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -350,7 +350,7 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src,
 	 * Now link the anon_vma's back to the newly inserted AVCs.
 	 * Note that all anon_vma's share the same root.
 	 */
-	anon_vma_lock_write(src->anon_vma);
+	anon_vma_lock_write(active_anon_vma);
 	list_for_each_entry_reverse(avc, &dst->anon_vma_chain, same_vma) {
 		struct anon_vma *anon_vma = avc->anon_vma;
 
-- 
2.55.0


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

* Re: [PATCH v2] mm/rmap: synchronize lock and unlock target in anon_vma_clone
  2026-08-17  2:34 [PATCH v2] mm/rmap: synchronize lock and unlock target in anon_vma_clone Eric Kim
@ 2026-08-17  2:37 ` Rik van Riel
  2026-08-17  3:07 ` Lance Yang
  1 sibling, 0 replies; 4+ messages in thread
From: Rik van Riel @ 2026-08-17  2:37 UTC (permalink / raw)
  To: Eric Kim, akpm
  Cc: david, ljs, liam, vbabka, harry, jannh, lance.yang, linux-mm,
	linux-kernel

On Mon, 2026-08-17 at 11:34 +0900, Eric Kim wrote:
> Currently, in anon_vma_clone(), active_anon_vma is assigned from
> src->anon_vma and is used when unlocking anon_vma after linking
> new AVCs. However, the corresponding lock operation uses
> src->anon_vma directly.
> 
> Use active_anon_vma consistently to make the lock/unlock pair
> explicit.
> 
> Signed-off-by: Eric Kim <seohyun.kim@outlook.kr>

Reviewed-by: Rik van Riel <riel@surriel.com>

-- 
All Rights Reversed.

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

* Re: [PATCH v2] mm/rmap: synchronize lock and unlock target in anon_vma_clone
  2026-08-17  2:34 [PATCH v2] mm/rmap: synchronize lock and unlock target in anon_vma_clone Eric Kim
  2026-08-17  2:37 ` Rik van Riel
@ 2026-08-17  3:07 ` Lance Yang
  2026-08-17 17:27   ` Lorenzo Stoakes (ARM)
  1 sibling, 1 reply; 4+ messages in thread
From: Lance Yang @ 2026-08-17  3:07 UTC (permalink / raw)
  To: Eric Kim
  Cc: david, ljs, riel, liam, vbabka, harry, jannh, linux-mm,
	linux-kernel, akpm



On 2026/8/17 10:34, Eric Kim wrote:
> Currently, in anon_vma_clone(), active_anon_vma is assigned from
> src->anon_vma and is used when unlocking anon_vma after linking
> new AVCs. However, the corresponding lock operation uses
> src->anon_vma directly.
> 
> Use active_anon_vma consistently to make the lock/unlock pair explicit.
> 
> Signed-off-by: Eric Kim <seohyun.kim@outlook.kr>
> ---
> v2:
> - Clarify the commit message to explain that src->anon_vma and
>    active_anon_vma refer to the same anon_vma.

Just a heads-up... since only the commit message changed, the Reviewed-by
tags from v1 still apply, so please carry them over ...

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

* Re: [PATCH v2] mm/rmap: synchronize lock and unlock target in anon_vma_clone
  2026-08-17  3:07 ` Lance Yang
@ 2026-08-17 17:27   ` Lorenzo Stoakes (ARM)
  0 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-08-17 17:27 UTC (permalink / raw)
  To: Lance Yang
  Cc: Eric Kim, david, riel, liam, vbabka, harry, jannh, linux-mm,
	linux-kernel, akpm

On Mon, Aug 17, 2026 at 11:07:49AM +0800, Lance Yang wrote:
>
>
> On 2026/8/17 10:34, Eric Kim wrote:
> > Currently, in anon_vma_clone(), active_anon_vma is assigned from
> > src->anon_vma and is used when unlocking anon_vma after linking
> > new AVCs. However, the corresponding lock operation uses
> > src->anon_vma directly.
> >
> > Use active_anon_vma consistently to make the lock/unlock pair explicit.
> >
> > Signed-off-by: Eric Kim <seohyun.kim@outlook.kr>
> > ---
> > v2:
> > - Clarify the commit message to explain that src->anon_vma and
> >    active_anon_vma refer to the same anon_vma.
>
> Just a heads-up... since only the commit message changed, the Reviewed-by
> tags from v1 still apply, so please carry them over ...

Yup, if you're not fundamentally changing the patch you should retain all
existing tags like this.

FWIW:

Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>

--
Cheers, Lorenzo

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

end of thread, other threads:[~2026-08-17 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-17  2:34 [PATCH v2] mm/rmap: synchronize lock and unlock target in anon_vma_clone Eric Kim
2026-08-17  2:37 ` Rik van Riel
2026-08-17  3:07 ` Lance Yang
2026-08-17 17:27   ` Lorenzo Stoakes (ARM)

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