From: Andi Kleen <ak@suse.de>
To: dada1 <dada1@cosmosbay.com>
Cc: linux-kernel@vger.kernel.org, aj@suse.de
Subject: Re: linux-2.6.1 x86_64 : STACK_TOP and text/data
Date: Tue, 27 Jan 2004 20:57:13 +0100 [thread overview]
Message-ID: <20040127205713.33ea65ee.ak@suse.de> (raw)
In-Reply-To: <4016BFD4.2040407@cosmosbay.com>
On Tue, 27 Jan 2004 20:45:24 +0100
dada1 <dada1@cosmosbay.com> wrote:
> Another thing I noticed in last glibc CVS (nptl)
>
> Thread stacks are also allocated in the 1GB quadrant :
>
> nptl/sysdeps/x86_64/pthreaddef.h
> /* We prefer to have the stack allocated in the low 4GB since this
> allows faster context switches. */
> #define ARCH_MAP_FLAGS MAP_32BIT
>
> Is this really true ?
> Is memory allocated in the low 4GB is faster on x86_64 (64bit kernel,
> 64 bit user prog ?)
That only applies to areas referenced set by set_thread_area() and
referenced by segment registers. For pointers <4GB it can use a faster method at
context switch.
They probably do that because they put the thread local data at the
bottom of the stack and it has to be referenced using %gs.
They should use a fallback if the MAP_32BIT allocation fails.
I suspect they would be better off if they allocated the thread local
data separately. The 2.4 kernel used to do the same, but switched to
separate allocation because this gives better cache colouring
(stacks tend to be aligned too much and use only parts of the cache)
MAP_32BIT only allocates in the first 2GB BTW, it's really MAP_31BIT.
-Andi
next prev parent reply other threads:[~2004-01-27 20:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <OFCE30A640.024A04A1-ONC1256E28.003023EA-C1256E28.0030BF4E@de.ibm.com.suse.lists.linux.kernel>
[not found] ` <40162E9A.1080005@cosmosbay.com.suse.lists.linux.kernel>
2004-01-27 18:24 ` linux-2.6.1 x86_64 : STACK_TOP and text/data Andi Kleen
2004-01-27 18:57 ` dada1
2004-01-27 19:29 ` Andi Kleen
2004-01-27 19:45 ` dada1
2004-01-27 19:57 ` Andi Kleen [this message]
2004-01-27 8:52 Cset 1.1490.4.201 - dasd naming Martin Schwidefsky
2004-01-27 9:25 ` linux-2.6.1 x86_64 : STACK_TOP and text/data dada1
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=20040127205713.33ea65ee.ak@suse.de \
--to=ak@suse.de \
--cc=aj@suse.de \
--cc=dada1@cosmosbay.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