From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 309543CBE79 for ; Fri, 14 Aug 2026 06:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786690392; cv=none; b=EfDRXqOLHosLXm6jAKhWyFn2cizY0MosbUvhj9ztHpW9Jyk+aydbDxgALmYjFhGG5nzzL2QULTE24wtzQhe8UQ0XSNZDz9bjtt2z1e64e1WX5bsgq8n0yT1yuo3aqGie+mEeTR/1TAVsqz6hChFxzDsOb6hwgVgXm709GhtkbDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786690392; c=relaxed/simple; bh=U046Ig+tqElqz3Lh/hedyKSGWxdFxrkXkqtnu6C4odA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=K6wOwUsYhtioRqtOp1g0n801YQZ79NgaHc+lMxj/KKpRUquMfzbF1kGq2zYJPAqtiwL8HLFrwyGtJe1WuD45O+LK2iOhd2+E/SWoKtGy89OgLZWwr8fh7ApHLOTDBO6AFZuL2Rs29x10I3GnWf9i14GzDW8gq4sclLqCcaow2tA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VAVUrAbj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VAVUrAbj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 873A21F000E9; Fri, 14 Aug 2026 06:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786690385; bh=r91VrULWIxu7vr9dZ9UHcHJgxG/0qo07oCBAGu5T0+I=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=VAVUrAbj2yNB2rqMnLwwLNTmASbaHD0lwQQX8lKdHEStNP+QR0SSXUskOLjA0mheR 8yJoUCsggz5hsDnWfCzCJI/IltkVo1roYVf8x0Duv0HEy3ubEpQvMwIVy3QlFue7R/ RlISDCuZ779kKsdQExcHbcUK0rPEwvT6iOxmOZ2KvkUl1ODAixmjl5Lni93XXZcUg7 gnOic6uP9sRV9F1kctSmdpREW6nAyjDpAXOpPUi6AB9U7vG/dbiFzLnfvuEaGSzl8C T4U37b/tN+ycpOcmqf9Zanfb8QDBvO6ok2lRjy3QpV9wgieuS3OmC8hMnn0gkqwKk5 vh9HdKmhxM2/w== Date: Fri, 14 Aug 2026 07:52:45 +0100 From: "Lorenzo Stoakes (ARM)" To: Eric Kim 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 Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 LGTM, so: Reviewed-by: Lorenzo Stoakes (ARM) > --- > 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