public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Andi Kleen <ak@muc.de>, linux-kernel@vger.kernel.org
Subject: Re: hammer: MAP_32BIT
Date: Sat, 10 May 2003 03:48:03 +0200	[thread overview]
Message-ID: <20030510014803.GA16407@averell> (raw)
In-Reply-To: <3EBBE7E2.1070500@redhat.com>

On Fri, May 09, 2003 at 07:39:46PM +0200, Ulrich Drepper wrote:
> 
> > In some vendor kernels it's already in /proc/pid/mapped_base, but that is 
> > quite costly to change. That would probably give you the best of both, Just 
> > set it to a low value for the thread stacks and then reset it to the default.
> > 
> > I guess that would be the better solution for your stacks. 
> 
> Are you sure this is the best solution?  It means the mmap regions for

No, I'm not sure.

On further thinking the mapped_base would not be useful for you currently,
because at least in the SuSE/AMD64 kernel it only applies to 32bit processes.

The real solution is probably to pass in the search start hint in mmap's
address argument and not use MAP_32BiT. 

e.g. use something like

	/* 
  	 * Current gcc still needs PROT_EXEC because it doesn't call
	 * __enable_execute_stack for trampolines yet.
 	 */
	stack = mmap(0x1000, stack_size, PROT_READ|PROT_WRITE|PROT_EXEC, 	
		     MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);

This will give you memory at the beginning of the address space and 
beyond 4GB if needed.

This may still be slow, but fixing the search algorithm is a different
problem that can be tackled separately.

> Oh, and please rename MAP_32BIT to MAP_31BIT.  This will save nerves on
> all sides.

I bet changing it will cost more nerves in supporting all these people
whose software doesn't compile anymore. And it's not really a lie. 2GB 
is 32bit too.

-Andi

  reply	other threads:[~2003-05-10  1:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-09  7:35 hammer: MAP_32BIT Ulrich Drepper
2003-05-09  9:20 ` Andi Kleen
2003-05-09 11:28   ` mikpe
2003-05-09 11:38     ` Andi Kleen
2003-05-09 11:52       ` mikpe
2003-05-09 12:16         ` Andi Kleen
2003-05-09 18:11       ` H. Peter Anvin
2003-05-09 19:24         ` Ulrich Drepper
2003-05-09 20:55           ` H. Peter Anvin
2003-05-09 21:45             ` Ulrich Drepper
2003-05-09 22:07               ` H. Peter Anvin
2003-05-09 22:20                 ` Ulrich Drepper
2003-05-09 22:21                   ` H. Peter Anvin
2003-05-09 22:20               ` Timothy Miller
2003-05-09 22:20                 ` H. Peter Anvin
2003-05-09 22:46                   ` Timothy Miller
2003-05-09 23:24                     ` H. Peter Anvin
2003-05-13 14:25                       ` Timothy Miller
2003-05-09 22:22                 ` Ulrich Drepper
2003-05-09 22:53                   ` Timothy Miller
2003-05-09 23:24                     ` Ulrich Drepper
2003-05-10  0:00                       ` Edgar Toernig
2003-05-10  0:58                         ` Ulrich Drepper
2003-05-10  2:51                           ` Edgar Toernig
2003-05-09 17:36   ` H. Peter Anvin
2003-05-09 17:39   ` Ulrich Drepper
2003-05-10  1:48     ` Andi Kleen [this message]
2003-05-10 20:10       ` David Woodhouse
2003-05-13 18:54         ` H. Peter Anvin

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=20030510014803.GA16407@averell \
    --to=ak@muc.de \
    --cc=drepper@redhat.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