From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
David Hildenbrand <david@redhat.com>,
Jann Horn <jannh@google.com>, Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Colin Cross <ccross@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 2/2] mm, madvise: move prctl_set_vma() to mm/madvise.c
Date: Tue, 24 Jun 2025 09:52:17 +0100 [thread overview]
Message-ID: <b908cd5e-fbe0-4edf-8111-4833b6b0b188@lucifer.local> (raw)
In-Reply-To: <b44b7cf4-d31b-436e-863b-c0edc88b1934@suse.cz>
On Tue, Jun 24, 2025 at 10:12:20AM +0200, Vlastimil Babka wrote:
> On 6/23/25 19:13, Lorenzo Stoakes wrote:
> >> +{
> >> + struct mm_struct *mm = current->mm;
> >> + const char __user *uname;
> >> + struct anon_vma_name *anon_name = NULL;
> >> + int error;
> >> +
> >> + switch (opt) {
> >> + case PR_SET_VMA_ANON_NAME:
> >
> > So I'd like to copy just the below over to madvise - we can decide to move stuff
> > around _later_ since it's really weird to have all the anon_vma_name stuff live
> > in madvise (apart from the stuff in include/linux/mm-inline.h obv) - but I think
> > that can be a follow-up patch.
>
> Sounds good, will try to come up with a name for that function then :)
I'd say set_anon_vma_name() is best, there's no need to mention that it's
madvise as y'know that's an mm internall and weird impl deail.
Also I guess we can keep madvise_set_anon_name() the same, even though
it'll be static now as it's in line with the weird convention of prefixing
things with madvise_ even though they're in madvise.c so, y'know, kinda
implied that they're related to madvise haha
>
> > I'd like to then split out bits and pieces to make this less yucky too.
> >
> > Maybe add anon_vma_name_from_user() grabbing the characters, doing the
> > strndup_user() etc., have it call a new anon_vma_name_validate() static function
> > which does the is_valid_name_char() check against all chars, etc.
>
> Right, I'm fine leaving the followup cleanups to someone else again. My
> biggest bother was patch 1 anyway :)
Yeah of course, incremental steps are valuable here, makes the next
person's life easier :)
>
> Thanks!
>
Thanks for doing this cleanup it's a big improvement!
Cheers, Lorenzo
prev parent reply other threads:[~2025-06-24 8:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-23 14:59 [PATCH RFC 0/2] madvise anon_name cleanups Vlastimil Babka
2025-06-23 14:59 ` [PATCH RFC 1/2] mm, madvise: simplify anon_name handling Vlastimil Babka
2025-06-23 15:39 ` Suren Baghdasaryan
2025-06-23 16:22 ` Liam R. Howlett
2025-06-23 16:47 ` Lorenzo Stoakes
2025-06-23 16:56 ` Lorenzo Stoakes
2025-06-24 8:03 ` Vlastimil Babka
2025-06-23 14:59 ` [PATCH RFC 2/2] mm, madvise: move prctl_set_vma() to mm/madvise.c Vlastimil Babka
2025-06-23 16:47 ` Suren Baghdasaryan
2025-06-23 16:58 ` Lorenzo Stoakes
2025-06-23 17:13 ` Lorenzo Stoakes
2025-06-24 8:12 ` Vlastimil Babka
2025-06-24 8:52 ` Lorenzo Stoakes [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=b908cd5e-fbe0-4edf-8111-4833b6b0b188@lucifer.local \
--to=lorenzo.stoakes@oracle.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=ccross@google.com \
--cc=david@redhat.com \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
/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