From: Matthew Wilcox <willy@infradead.org>
To: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
Helge Deller <deller@gmx.de>, Yang Shi <shy828301@gmail.com>,
Helge Deller <deller@kernel.org>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-parisc@vger.kernel.org
Subject: Re: [PATCH] [RFC] mm: mmap: Allow mmap(MAP_STACK) to map growable stack
Date: Thu, 12 Sep 2024 19:12:26 +0100 [thread overview]
Message-ID: <ZuMvCjS8G5ggz6Hy@casper.infradead.org> (raw)
In-Reply-To: <x2d4kyyeclp5fgeug2l3bjalp773ozgkl5vr5o7dpqcbopampg@5a3x2cr456qp>
On Wed, Sep 11, 2024 at 09:32:29PM -0400, Liam R. Howlett wrote:
> * Helge Deller <deller@gmx.de> [240911 20:51]:
> > On 9/12/24 01:05, Liam R. Howlett wrote:
> > > If someone is using MAP_STACK to avoid having a huge page, they will
> > > also get a mapping that grows - which is different than what happens
> > > today.
> > >
> > > I'm not saying that's right, but someone could be abusing the existing
> > > flag and this will change the behaviour.
> >
> > Wouldn't a plain mmap() followed by madvise(MADV_NOHUGEPAGE) do exactly that?
> > Why abusing MAP_STACK for that?
>
> I can think of two answers:
> 1. An error that has worked without issues so far
> 2. One less system call
>
> I'm not saying this really is a blocker, but the change is not without
> risk as it does change behaviour the user could see.
>
> Interestingly enough, the man page is incorrect as it is written because
> the flag is not strictly a no-op; it ensures no huge pages. So the
> feature of applying VM_NOHUGEPAGE with the use of MAP_STACK is not
> documented today.
It's a recent change and I don't think it's something we necessarily
want to document. It was c4608d1bf7c6 which was December 2023.
next prev parent reply other threads:[~2024-09-12 18:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 19:20 Helge Deller
2024-09-11 19:48 ` Liam R. Howlett
2024-09-11 22:16 ` Yang Shi
2024-09-11 23:05 ` Liam R. Howlett
2024-09-12 0:50 ` Helge Deller
2024-09-12 1:08 ` Yang Shi
2024-09-12 1:42 ` Liam R. Howlett
2024-09-12 2:39 ` Yang Shi
2024-09-12 1:45 ` Helge Deller
2024-09-12 1:32 ` Liam R. Howlett
2024-09-12 2:09 ` Helge Deller
2024-09-12 15:43 ` Liam R. Howlett
2024-09-12 17:37 ` Helge Deller
2024-09-15 20:04 ` Helge Deller
2024-09-12 18:12 ` Matthew Wilcox [this message]
2024-09-12 1:05 ` Yang Shi
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=ZuMvCjS8G5ggz6Hy@casper.infradead.org \
--to=willy@infradead.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=deller@gmx.de \
--cc=deller@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-parisc@vger.kernel.org \
--cc=shy828301@gmail.com \
/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