Re: heap-stack-gap for 2.6

From: Hui Huang (Hui.Huang_at_Sun.COM)
Date: 09/30/04

  • Next message: Pavel Machek: "Re: 2.6.9-rc2-mm[2-4]: zaphod-scheduler.patch makes swsusp incredibly slow (was: Re: 2.6.9-rc2-mm3: swsusp horribly slow on AMD64)"
    Date:	Wed, 29 Sep 2004 15:01:13 -0700
    To: Andrea Arcangeli <andrea@novell.com>
    
    

    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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Pavel Machek: "Re: 2.6.9-rc2-mm[2-4]: zaphod-scheduler.patch makes swsusp incredibly slow (was: Re: 2.6.9-rc2-mm3: swsusp horribly slow on AMD64)"

    Relevant Pages

    • Re: wie Array =?ISO-8859-15?Q?f=FCr_statische_Methoden?=
      ... Wenn du eine Sprache haben willst in der du nicht so viel Tippen willst, dann würde ich dir auf gar keinen Fall Java empfehlen;) ... Das würde die Sache relativ kompakt machen, weil du keine Methodennamen brauchst und das switch gleich mitschreibst. ... Ich hab mal mit virtuellen Methoden auf einem Microkontroller experimentiert und bin zu dem Schluss gekommen: "Wenn ich virtuelle Methoden möchte dann muss ich damit leben das diese langsamer sind, selbst wenn ich das ganze in Assembler mache." ... dann brauchst du Platz auf dem Stack... ...
      (de.comp.lang.java)
    • Re: Groovy (war Re: [PROST]Re: CDC Plugin fuer Eclipse)
      ... Dabei muss nicht jedesmal der Stack gesichert werden, sodass es keine StackoverflowExpcetion geben kann. ... Java und der VM, keine Ahnung was C# da intern macht bzw. machen will. ... Ihr habt ja nur die dynamischen Typen und macht daher etwas, das auch Dylan und andere Sprachen mit dynamischen statt statischen Dispatch machen - und das ist sehr aufwendig. ...
      (de.comp.lang.java)
    • Re: socket.close() bleibt =?ISO-8859-1?Q?h=E4ngen?=
      ... Versuchen immer der lesende Thread zuerst das RST mit und schliesst den ... Use 'java -Xss' to increase default stack size. ... Java HotSpotClient VM warning: Attempt to unguard stack red zone ...
      (de.comp.lang.java)
    • Re: simultaneous function calls
      ... so that each request is going to be satisfied sooner or later, ... The thread manager stored its registers and stack ... not Java handles most of this. ...
      (comp.lang.java.programmer)
    • Re: Patch 4/6 randomize the stack pointer
      ... Stack test after execstack -c *. ... Note that I'm referring to the Java PLUG-IN, ... ProPolice protects local variables with 0 overhead; ...
      (Linux-Kernel)