From: Michal Hocko <mhocko@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>, Hugh Dickins <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Larry Woodman <lwoodman@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/1] expand_downwards: don't require the gap if !vm_prev
Date: Fri, 30 Jun 2017 19:26:02 +0200 [thread overview]
Message-ID: <20170630172602.GD9714@dhcp22.suse.cz> (raw)
In-Reply-To: <CA+55aFyLyhRtiZ0y3Mv-g0jLf3eHEJF_s+YUhim2bWAiYzRfSA@mail.gmail.com>
On Fri 30-06-17 10:08:03, Linus Torvalds wrote:
> On Fri, Jun 30, 2017 at 6:24 AM, Michal Hocko <mhocko@kernel.org> wrote:
> >
> > FWIW our gcc guys shown an interest in having something to tell the
> > kernel how much the stack can grow at once. They want it for testing of
> > the new stack probing alloca implementation.
>
> Here, I made this just for them:
>
> #define STACK_GROWTH_SIZE (4096)
>
> isn't that beautiful? A new kernel interface without some stupid sysfs
> file for it.
>
> And the added advantage is that it compiles to nice dense code too.
>
> > I have something
> > preliminary with /proc/<pid>/stack_expand_limit for the internal testing
> > purpose but maybe there will be more interest for this. I
>
> NO NO NO.
>
> I absolutely refuse to see the stack gap as some kind of "this is how
> much you can grow the stack without probing".
>
> That's complete and utter garbage.
>
> Tell them that they can grow the stack by 4kB. That's it. If they want
> to get all fancy, and they say that they really want an
> architecture-specific value, tell them to use getpagesize().
Ohh, you misunderstood I guess. They wanted that only for internal
testing (e.g. make sure that everything that matters blows up if it is
doing something wrong). Absolutely nothing to base any compilator
decistion on.
> The stack gap is there due to the ABI being broken. If we're fixing
> the ABI, then the stack gap has *nothing* to add.
Yeah I know. The only usecase why I thought this might be interesting is
when you run the code you haven't compiled with a compiler which does
the proper thing. Think of all the 3rd party stuff that you eventually
_need_ to run. Then you have also a hard guess to tune your gap for. If
you can blow on/warn about unexpectedly large stack expansions then you
can protect that particular piece of SW.
But as I've said, this is not something I planned to post upstream but
you mentioning a warning made me think that I could just mention it.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2017-06-30 17:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 17:52 Oleg Nesterov
2017-06-28 17:52 ` [PATCH 1/1] " Oleg Nesterov
2017-06-30 13:16 ` Michal Hocko
2017-06-28 23:26 ` [PATCH 0/1] " Linus Torvalds
2017-06-29 15:19 ` Oleg Nesterov
2017-06-29 18:21 ` Linus Torvalds
2017-06-29 18:55 ` Oleg Nesterov
2017-06-29 19:00 ` Linus Torvalds
2017-06-30 13:24 ` Michal Hocko
2017-06-30 17:08 ` Linus Torvalds
2017-06-30 17:26 ` Michal Hocko [this message]
2017-06-30 17:48 ` Linus Torvalds
2017-07-03 15:49 ` Michal Hocko
2017-07-03 16:30 ` Linus Torvalds
2017-07-03 16:54 ` Michal Hocko
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=20170630172602.GD9714@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lwoodman@redhat.com \
--cc=oleg@redhat.com \
--cc=torvalds@linux-foundation.org \
/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
all inboxes | Powered by JetHome®