From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Ye Liu <ye.liu@linux.dev>
Cc: Harry Yoo <harry.yoo@oracle.com>,
akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Ye Liu <liuye@kylinos.cn>,
David Hildenbrand <david@redhat.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH] mm/rmap: Move anon_vma initialization to anon_vma_ctor()
Date: Wed, 16 Apr 2025 13:59:21 +0100 [thread overview]
Message-ID: <fde494a5-f5bc-4d5b-ae73-9fe2106e966c@lucifer.local> (raw)
In-Reply-To: <0696eaac-943f-4116-b682-f9b15de6aeaf@linux.dev>
+cc David, Liam
On Wed, Apr 16, 2025 at 09:34:30AM +0800, Ye Liu wrote:
>
> 在 2025/4/15 19:28, Harry Yoo 写道:
> > On Tue, Apr 15, 2025 at 05:25:48PM +0800, Ye Liu wrote:
> >> From: Ye Liu <liuye@kylinos.cn>
> >>
> >> Currently, some initialization of anon_vma is performed in
> >> anon_vma_alloc(). Move the initialization to anon_vma_ctor()
> >> so that all object setup is handled in one place.
> >>
> >> Signed-off-by: Ye Liu <liuye@kylinos.cn>
> >> ---
> > NACK unless the patch explains how the object's initial state
> > ('constructed state') is preserved between uses.
> >
> > anon_vma_ctor() is a slab constructor. That means it is called only once
> > when a slab (folio) is allocated, and not called again when an anon_vma
> > is allocated from an existing slab (folio). In other words it is not called
> > everytime an object allocated via kmem_cache_alloc() interface.
> Thank you for the feedback. You're absolutely right — I misunderstood
> how the slab constructor (ctor) works. I had assumed it would be called
> every time an object is allocated via kmem_cache_alloc(), but I now
> realize it is only called once when a new slab is initialized, not on
> every object allocation.
> > This patch looks very dangerous to me and makes me question whether you
> > tested it before submission.
> >
> Appreciate you catching this — and yes, I'll test it more thoroughly
> before submitting other patches.
>
> Drop it.
>
> Thanks,
> Ye
>
I agree with Harry's assessment, also this is something that needs to be cc'd to
other developers - I am more generally working on anon_vma at the moment and
this is vma-adjacent even if slab-ish :)
It isn't your fault that you didn't, we need a MAINTAINERS entry for this which
I will submit, but for any future revision, please do cc Harry, David, Liam,
Vlastimil + myself.
I should be sending a MAINTAINERS patch later today which should correct this
going forward!
Cheers, Lorenzo
next prev parent reply other threads:[~2025-04-16 12:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-15 9:25 Ye Liu
2025-04-15 11:28 ` Harry Yoo
2025-04-16 1:34 ` Ye Liu
2025-04-16 12:59 ` Lorenzo Stoakes [this message]
2025-04-16 13:02 ` David Hildenbrand
2025-04-16 13:30 ` Mateusz Guzik
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=fde494a5-f5bc-4d5b-ae73-9fe2106e966c@lucifer.local \
--to=lorenzo.stoakes@oracle.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=harry.yoo@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuye@kylinos.cn \
--cc=vbabka@suse.cz \
--cc=ye.liu@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox