[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d41bc94a-0ea4-48fb-905e-a6603682fce7@lucifer.local>
Date: Thu, 15 Jan 2026 09:14:31 +0000
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Suren Baghdasaryan <surenb@...gle.com>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Shakeel Butt <shakeel.butt@...ux.dev>,
David Hildenbrand <david@...nel.org>, Rik van Riel <riel@...riel.com>,
Harry Yoo <harry.yoo@...cle.com>, Jann Horn <jannh@...gle.com>,
Mike Rapoport <rppt@...nel.org>, Michal Hocko <mhocko@...e.com>,
Pedro Falcato <pfalcato@...e.de>, Chris Li <chriscli@...gle.com>,
Barry Song <v-songbaohua@...o.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/8] mm/rmap: remove unnecessary root lock dance in
anon_vma clone, unmap
On Wed, Jan 14, 2026 at 02:12:04PM -0800, Andrew Morton wrote:
> On Wed, 14 Jan 2026 17:54:07 +0000 Lorenzo Stoakes <lorenzo.stoakes@...cle.com> wrote:
>
> > > > {
> > > > @@ -310,26 +284,28 @@ static void cleanup_partial_anon_vmas(struct vm_area_struct *vma);
> > > > int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src)
> > > > {
> > > > struct anon_vma_chain *avc, *pavc;
> > > > - struct anon_vma *root = NULL;
> > > >
> > > > check_anon_vma_clone(dst, src);
> > > >
> > > > if (!src->anon_vma)
> > > > return 0;
> > > >
> > > > + check_anon_vma_clone(dst, src);
> > >
> > > check_anon_vma_clone() was already called 4 lines above. I'm guessing
> > > this was accidentally carried over from the previous version?
> > >
> >
> > Yeah I don't know why this is here, in the tree it isn't, maybe Andrew noticed
> > and elided? :)
>
> Thanks, but I wouldn't have done that silently.
Yeah I didn't think you would!
>
> The later "mm/rmap: separate out fork-only logic on anon_vma_clone()" removed it:
>
> : @@ -281,17 +317,17 @@ static void cleanup_partial_anon_vmas(st
> : *
> : * Returns: 0 on success, -ENOMEM on failure.
> : */
> : -int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src)
> : +int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src,
> : + enum vma_operation operation)
> : {
> : struct anon_vma_chain *avc, *pavc;
> : + struct anon_vma *active_anon_vma = src->anon_vma;
> :
> : - check_anon_vma_clone(dst, src);
> : + check_anon_vma_clone(dst, src, operation);
> :
> : - if (!src->anon_vma)
> : + if (!active_anon_vma)
> : return 0;
> :
> : - check_anon_vma_clone(dst, src);
> : -
> : /*
> : * Allocate AVCs. We don't need an anon_vma lock for this as we
> : * are not updating the anon_vma rbtree nor are we changing
>
Thanks yeah we figured it out, luckily it's completely benign so not a
bisection hazard so good to leave as is, but still also - doh! :)
Cheers, Lorenzo
Powered by blists - more mailing lists