mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Andi Kleen <ak@muc.de>, "David S. Miller" <davem@redhat.com>,
	mingo@elte.hu, riel@redhat.com, torvalds@osdl.org,
	arjanv@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: 4k stacks in 2.6
Date: Thu, 27 May 2004 16:59:35 +0200	[thread overview]
Message-ID: <20040527145935.GE23194@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <20040527144916.GE3889@dualathlon.random>

On Thu, 27 May 2004 16:49:16 +0200, Andrea Arcangeli wrote:
> On Thu, May 27, 2004 at 04:15:47PM +0200, Jörn Engel wrote:
> > 
> > Would it be possible to add something short to the function preamble
> > on x86 then?  Similar to this code, maybe:
> > 
> > if (!(stack_pointer & 0xe00))	/* less than 512 bytes left */
> > 	*NULL = 1;
> > 
> > Not sure how this can be translated into short and fast x86 assembler,
> > but if it is possible, I would really like to have it.  Then all we
> > have left to do is make sure no function ever uses more than 512
> > bytes.  Famous last words, I know.
> 
> If it would be _inlined_ it would be *much* faster, but it would likely
> be measurable anyways. Less measurable though. There's no way with gcc
> to inline the above in the preamble, one could hack gcc for it though
> (there's exactly an asm preable thing in gcc that is the one that is
> currently implemented as call mcount plus the register saving, chaning
> it to the above may be feasible, though it would need a new option in
> gcc)

It is on my list, although I care more about ppc32.  Can anyone
translate the above into assembler?

> another nice thing to have (this one zerocost at runtime) would be a
> way to set a limit on the size of the local variables for each function.
> gcc knows that value very well, it's the sub it does on the stack
> pointer the first few asm instructions after the call.  That would
> reduce the common mistakes.  An equivalent script is the one from Keith
> Owens checking the vmlinux binary after compilation but I'm afraid
> people runs that one only after the fact.

Plus the script is wrong sometimes.  I have had trouble with sizes
around 4G or 2G, and never found the time to really figure out what's
going on.  Might be an alloca thing that got misparsed somehow.

Having the check in gcc should cause less surprises.

Jörn

-- 
It's not whether you win or lose, it's how you place the blame.
-- unknown

  reply	other threads:[~2004-05-27 15:01 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1ZQpn-1Rx-1@gated-at.bofh.it>
     [not found] ` <1ZQz8-1Yh-15@gated-at.bofh.it>
     [not found]   ` <1ZRFf-2Vt-3@gated-at.bofh.it>
     [not found]     ` <203Zu-4aT-15@gated-at.bofh.it>
2004-05-26 13:57       ` Andi Kleen
2004-05-26 18:17         ` hch
2004-05-26 18:24           ` Andi Kleen
2004-05-26 20:39         ` Zwane Mwaikambo
     [not found]       ` <206b3-5WN-33@gated-at.bofh.it>
     [not found]         ` <20baw-1Lz-15@gated-at.bofh.it>
2004-05-26 19:32           ` Andi Kleen
2004-05-27 11:27             ` Jörn Engel
2004-05-27 13:49               ` Andrea Arcangeli
2004-05-27 14:15                 ` Jörn Engel
2004-05-27 14:49                   ` Andrea Arcangeli
2004-05-27 14:59                     ` Jörn Engel [this message]
2004-05-27 15:08                       ` Keith Owens
2004-05-27 15:21                         ` Jörn Engel
2004-05-27 15:34                           ` Arjan van de Ven
2004-05-27 15:46                             ` Jörn Engel
2004-06-01  5:25                             ` Jörn Engel
2004-05-26 15:17 Albert Cahalan
  -- strict thread matches above, loose matches on Subject: below --
2004-05-25 19:50 4g/4g for 2.6.6 Rik van Riel
2004-05-25 20:10 ` Rik van Riel
2004-05-25 21:15   ` Andrea Arcangeli
2004-05-26 10:33     ` 4k stacks in 2.6 Ingo Molnar
2004-05-26 12:50       ` Jörn Engel
2004-05-26 12:53         ` Arjan van de Ven
2004-05-26 13:00           ` Jörn Engel
2004-05-26 13:05             ` Arjan van de Ven
2004-05-26 16:41               ` Jörn Engel
2004-05-27 12:45                 ` Ingo Molnar
2004-05-27 13:59                   ` Andrea Arcangeli
2004-05-27 14:03                     ` Arjan van de Ven
2004-05-27 14:42                       ` Andrea Arcangeli
2004-06-02 19:40                         ` Bill Davidsen
2004-05-27 14:18                     ` Brian Gerst
2004-05-27 14:50                       ` Andrea Arcangeli
2004-05-27 14:55                         ` Linus Torvalds
2004-05-27 15:39                           ` Andrea Arcangeli
2004-05-27 18:31                           ` Guy Sotomayor
2004-05-27 19:26                             ` Brian Gerst
2004-06-07 18:14             ` Timothy Miller
2004-06-08  6:26               ` Arjan van de Ven
2004-06-08  8:45                 ` Jörn Engel
2004-05-26 18:12         ` David S. Miller
2004-05-26 19:02           ` Matt Mackall
2004-05-26 19:25             ` Dave Jones

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=20040527145935.GE23194@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=ak@muc.de \
    --cc=andrea@suse.de \
    --cc=arjanv@redhat.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=riel@redhat.com \
    --cc=torvalds@osdl.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®