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 7FFB3390618 for ; Mon, 17 Aug 2026 07:43:44 +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=1786952625; cv=none; b=WrezXRHHHw62upqj/lOh8LMH6DODzFQKUG56nkHszX2BtwiyqVVaUI0dQaYR0LVtge7NH/5nxjwOF/Wo84Jn72uKIWOEVGjmMuZScpxmUCKWKpnrwZRvvos14G7vWXX/bEJmsZKgPpAqMBMb+8qpQzKYVuAFhaO+C2J5I3xWlW8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786952625; c=relaxed/simple; bh=2FzT8/A5Ap1k+dXGqHW5wnBh1mCxQpUmH3XQqfKKzKU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NTUFy+zBlZFDDQ/6UopuKYe6UdWn/AZ9QrG13xPq4aMUixg4He61AL3ZT7GufGgCYk1KtkrrkiXnHC1uwbFIuDd9rDn5McRnAfypkCoGF8ymMTdvOu4kSLnqdYuHQ+40PYbpceT+y5du2TpSh/EzeEFWyozWPt5LQoV92iSorgA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JUoBGxsw; 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="JUoBGxsw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCB4D1F000E9; Mon, 17 Aug 2026 07:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786952624; bh=AOLwOWFWj2EYoYuWpXUI7EDELr3uGT+bmLAYafUVkn0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=JUoBGxswlMbMNlRDd6T3OhgILdAnkLgoonaUHwmaP+Oif9MmC9/AD6RRobKpLvEob ALnBBdihKWjC+fkxlWbldyGwDfCnozHWOvvLuQPvVf2HdLSVLwUP+7yphSV0cCDcNk dxM5OFqOjCLdqZ6d3s1nrrRAscdPc0HQjzVhRw20r+iofJxeVWVgvV6rln3gyG5l0y Q1cHzjkyp8nYPwohNJxyvsVBHfIopB13EgE430aeRNqznB8Gf25bfLgaVlC1nCln3K 0Nol2Y1sJ5fntS32nXYySYpgjCDb3eK9qAVARupMYbzVnaXQIyr3/UFadpW9oKHH54 6tQ9XJpJ7wcSQ== Date: Mon, 17 Aug 2026 08:43:25 +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, Barry Song Subject: Re: [PATCH v4] 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 Mon, Aug 17, 2026 at 02:25:11PM +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. > > Although they are actually the same thing, use active_anon_vma > consistently to make the lock/unlock pair explicit. Thanks! LGTM (Your email bounced for me last time so not sure you'll see this :) > > Signed-off-by: Eric Kim > Reviewed-by: Lorenzo Stoakes (ARM) > Reviewed-by: Lance Yang > Reviewed-by: Rik van Riel > Reviewed-by: Barry Song > --- > v2: > - Clarify the commit message to explain that src->anon_vma and > active_anon_vma refer to the same anon_vma. > v3: > - Carry over review tags from v2. > v4: > - Clarify ctive_anon_vma and src->anon_vma refer to the same > anon_vma. Extremely petty nit - and you don't have to do anything this is just for the future: - Prefer a reverse order, so latest revision at the top. - Nice to have lore links to previous revisions. :) > > 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