mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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: Mon, 3 Jul 2017 18:54:12 +0200	[thread overview]
Message-ID: <20170703165412.GG11848@dhcp22.suse.cz> (raw)
In-Reply-To: <CA+55aFzWKK5sLNbWjJ3gKn9KyGkYNJyxp=w==0FfRCgWgRvUYw@mail.gmail.com>

On Mon 03-07-17 09:30:35, Linus Torvalds wrote:
> On Mon, Jul 3, 2017 at 8:49 AM, Michal Hocko <mhocko@kernel.org> wrote:
> >
> > If you think this is worth pursuing in upstream, just let me know and I
> > can polish it, add a patch for the man page and other things.
> 
> Hmm. This doesn't look bad, except the bprm games there really look annoying.
> 
> Also, I'm wondering whether this should be per-thread - conceptually
> "expand_stack()" really is a thread thing. All callers are using
> "current", although it's not always obvious.
> 
> So I'm wondering if a slightly larger patch that simply made the
> "limit" be an _argument_ to expand_stack() would clean up both of
> these issues. The execve() use would simply pass in the stack limit,
> and the fault users would pass in "current->expand_stack_limit".
> 
> Again, I'm not sure how many people really use multiple GROW_DOWN
> stacks for threading, but it's conceptually the right thing to do, so
> I think conceptually this should be per-thread. And the fact that it
> might clean up the execve() thing makes me think it's the right thing
> to do.
> 
> What do you think?

I am not sure about the per-thread vs. per mm part. If for nothing else,
MAP_GROWSDOWN can be something else than the main thread stack which can be
modified by all threads and then the semantic would be quite surprising
if different threads had a different idea about the expansion. No?

But an additional argument to expand_stack would surely clean things
up a bit and will get rid of the ugly bprm part as well. I will think
about it some more and then post the patch to linux-api to have a larger
audience.

Thanks!
-- 
Michal Hocko
SUSE Labs

      reply	other threads:[~2017-07-03 16:54 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
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 [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=20170703165412.GG11848@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®