public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hui Huang <Hui.Huang@Sun.COM>
To: Andrea Arcangeli <andrea@novell.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: heap-stack-gap for 2.6
Date: Wed, 29 Sep 2004 15:01:13 -0700	[thread overview]
Message-ID: <415B30A9.5030103@sun.com> (raw)
In-Reply-To: <20040929142325.GK4084@dualathlon.random>

Andrea Arcangeli wrote:
> 
>>Now another wish - instead of a system-wide property, a per-process
>>mechanism to change heap-stack-gap. Applications that need the gap
>>can set up the appropriate size, while others like Java that manage
>>heap and stack can simply disable the gap. Is it possible?
> 
> 
> This is a very reasonable request, and yes, this is definitely possible,
> I feel this is a much better feature than the mprotect trapping, which
> is possible too, but it sounds not worth it.
> 
> As for the api, should that be a prctl, /proc/<pid>/heap-stack-gap, or a
> brand new syscall? I personally enjoy the /proc/<pid>/heap-stack-gap
> approach, but that's just me, the prctl and syscall would be more
> efficient at runtime (but the point is that this doesn't need to be more
> efficient and echo xx > /proc/<pid>/heap-stack-gap is so much easier to
> play with for experiments)

Hi Andrea,

 From our perspective prctl is the most attractive approach. Performance
is not an issue, as it's only used once during startup. The problem
with /proc is that we are not always able to access /proc (e.g.
java code is run with chroot). Stack overflow in chroot'ed program
probably is a corner case, but I'm afraid we'll have to deal with it
if the heap-stack-gap becomes more widespread. System call is better
but we need to remember different syscall numbers on different
platforms.

> 
> If we can choose the API together I'll take care of implementing the
> rest. I'd like to still leave a global sysctl for global system safety
> (since most apps needs it and they won't all be required to tune it by
> hand), so that the final number will be choose with:
> 
> 	if (likely(per_process_setting < 0))
> 		return global_sysctl;
> 	else
> 		return per_process_setting;


Sounds good.

thanks,
-hui

  reply	other threads:[~2004-09-29 22:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-25 16:22 heap-stack-gap for 2.6 Andrea Arcangeli
2004-09-25 23:57 ` Rik van Riel
2004-09-26  0:40   ` Andrea Arcangeli
2004-09-27  8:09 ` Arjan van de Ven
2004-09-27 13:09   ` Andrea Arcangeli
2004-09-28 19:43     ` Arjan van de Ven
2004-09-28 22:19       ` Andrea Arcangeli
2004-09-29  6:05         ` Arjan van de Ven
2004-09-29 14:11           ` Andrea Arcangeli
2004-09-29 14:24             ` Alan Cox
2004-09-29 15:44               ` Andrea Arcangeli
2004-09-29 14:25             ` Arjan van de Ven
2004-09-29 14:53               ` Andrea Arcangeli
2004-09-29 15:01                 ` Arjan van de Ven
2004-09-29 15:40                   ` Andrea Arcangeli
2004-09-28  6:25 ` Hui Huang
2004-09-28 14:19   ` Andrea Arcangeli
2004-09-29  8:42     ` Hui Huang
2004-09-29 14:23       ` Andrea Arcangeli
2004-09-29 22:01         ` Hui Huang [this message]
2004-10-12  0:51           ` Andrea Arcangeli

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=415B30A9.5030103@sun.com \
    --to=hui.huang@sun.com \
    --cc=akpm@osdl.org \
    --cc=andrea@novell.com \
    --cc=linux-kernel@vger.kernel.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