All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: Eric Kim <seohyun.kim@outlook.kr>
Cc: akpm@linux-foundation.org, david@kernel.org, riel@surriel.com,
	 liam@infradead.org, vbabka@kernel.org, harry@kernel.org,
	jannh@google.com,  lance.yang@linux.dev, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/rmap: synchronize lock and unlock target in anon_vma_clone
Date: Fri, 14 Aug 2026 07:52:45 +0100	[thread overview]
Message-ID: <an65yrLUoB46pgHd@lucifer> (raw)
In-Reply-To: <OS7PR01MB139142FE16EC63B892559D40496DA2@OS7PR01MB13914.jpnprd01.prod.outlook.com>

On Fri, Aug 14, 2026 at 03:30:51PM +0900, Eric Kim wrote:
> Currently, in anon_vma_clone(), src vma's anon_vma is assigned to
> active_anon_vma and is used when unlocking anon_vma after linking new
> AVCs. However, the anon_vma is locked using src->anon_vma, instead of
> active_anon_vma, making the lock and unlock target inconsistent.

IOW, I added active_anon_vma as an alias to src->anon_vma but didn't use it
consistently in the function :)

>
> Use active_anon_vma for both locking and unlocking.
>
> Signed-off-by: Eric Kim <seohyun.kim@outlook.kr>

LGTM, so:

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

> ---
>  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
>

--
Cheers, Lorenzo


      reply	other threads:[~2026-08-14  6:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14  6:30 [PATCH] mm/rmap: synchronize lock and unlock target in anon_vma_clone Eric Kim
2026-08-14  6:52 ` Lorenzo Stoakes (ARM) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=an65yrLUoB46pgHd@lucifer \
    --to=ljs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=harry@kernel.org \
    --cc=jannh@google.com \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=riel@surriel.com \
    --cc=seohyun.kim@outlook.kr \
    --cc=vbabka@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.