From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>,
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>,
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: Mon, 23 Jun 2025 17:58:17 +0100 [thread overview]
Message-ID: <d882dbe6-2a8a-4fe4-90e2-b170f6e4d519@lucifer.local> (raw)
In-Reply-To: <CAJuCfpHA9hMbDfeW9kh5m0ZWOLaxya3PrwNh9e6rZDqQyu0gAw@mail.gmail.com>
On Mon, Jun 23, 2025 at 09:47:49AM -0700, Suren Baghdasaryan wrote:
> > -static int prctl_set_vma(unsigned long opt, unsigned long addr,
> > - unsigned long size, unsigned long arg)
> > -{
> > - 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:
> > - uname = (const char __user *)arg;
>
> My issue with this refactoring is that prctl_set_vma() might grow some
> other opt which does not belong in madvise.c. Moving it into vma.c
> seems a bit more appropriate IMHO.
And this itself is an argument against the horror show that is prctl()...! :)
Anyway we'd have to find a way to abstract past this, since vma.c is
inaccessible to anything outside of mm.
This is part of the reason I so _hate_ prctl() - we do mm stuff there, in a
place that shouldn't...
I'll reply to patch directly as I have thoughts here though
next prev parent reply other threads:[~2025-06-23 16:58 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 [this message]
2025-06-23 17:13 ` Lorenzo Stoakes
2025-06-24 8:12 ` Vlastimil Babka
2025-06-24 8:52 ` Lorenzo Stoakes
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=d882dbe6-2a8a-4fe4-90e2-b170f6e4d519@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