From: "Kevin Pedretti" <ktpedre@sandia.gov>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Bug 350] New: i386 context switch very slow compared to 2.4 due to wrmsr (performance)
Date: Tue, 18 Mar 2003 07:24:41 -0800 [thread overview]
Message-ID: <3E773A39.2090403@sandia.gov> (raw)
In-Reply-To: <b2cnit$7e6$1@penguin.transmeta.com>
Linus,
I wasn't aware of what you state below but it makes sense. What I
haven't been able to figure out, and nobody seems to know, is why the
rodata section of an executable is placed in the text section and is not
page aligned. This seems to be a mixing of code and data on the same
page. Maybe it doesn't matter since it is read only?
Example:
11 .text 000000e8 08048244 08048244 00000244 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .fini 0000001c 0804832c 0804832c 0000032c 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
13 .rodata 0000000c 08048348 08048348 00000348 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
14 .data 0000000c 08049354 08049354 00000354 2**2
CONTENTS, ALLOC, LOAD, DATA
Thanks,
Kevin
torvalds@transmeta.com wrote:
>In article <20030212041848.GA9273@bjl1.jlokier.co.uk>,
>Jamie Lokier <jamie@shareable.org> wrote:
>
>
>>A cute and wonderful hack is to use the 6 words in the TSS prior to
>>&tss->es as the trampoline. Now that __switch_to is done in software,
>>those words are not used for anything else.
>>
>>
>
>No!!
>
>That's not cute and wonderful, that's _horrible_.
>
>Mixing data and code on the same page is very very slow on a P4 (well, I
>think it's "same half-page", but the point is that you should not EVER
>mix data and code - it ends up being slow on modern CPU's).
>
>
>
>>Other fixed offsets from &tss->esp0 are possible - especially nice
>>would be to share a cache line with the GDT's hot cache line. (To do
>>this, place GDT before TSS, make KERNEL_CS near the end of the GDT,
>>and then the accesses to GDT, trampoline and tss->esp0 will all touch
>>the same cache line if you're lucky).
>>
>>
>
>Since almost all x86 CPU's have some kind of cacheline exclusion policy
>between the I$ and the D$ (to handle the strict x86 I$ coherency
>requirements), your "if you're lucky" is completely bogus. In fact,
>you'd be the _pessimal_ cache behaviour for something like that, ie you
>get lines that ping-pong between the L2 and the two instruction caches.
>
>Don't do it. Keep data and code on separate pages.
>
> Linus
>-
>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 prev parent reply other threads:[~2003-03-18 15:15 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-12 1:35 [Bug 350] New: i386 context switch very slow compared to 2.4 due to wrmsr (performance) Martin J. Bligh
2003-02-12 2:59 ` Dave Jones
2003-02-12 4:21 ` Jamie Lokier
2003-02-12 5:49 ` Linus Torvalds
2003-02-12 10:12 ` Jamie Lokier
2003-03-10 3:07 ` Linus Torvalds
2003-03-10 11:06 ` Andi Kleen
2003-03-10 18:33 ` Linus Torvalds
2003-03-10 22:44 ` Linus Torvalds
2003-02-12 12:54 ` Dave Jones
2003-02-12 7:50 ` Andi Kleen
2003-02-12 10:27 ` Jamie Lokier
2003-02-12 10:45 ` Andi Kleen
2003-02-12 17:52 ` Ingo Oeser
2003-02-12 18:13 ` Dave Jones
2003-02-12 18:18 ` Andi Kleen
2003-02-13 2:42 ` Alan Cox
2003-02-13 5:17 ` Eric W. Biederman
2003-02-13 18:07 ` Andi Kleen
2003-02-14 0:14 ` [discuss] " Peter Tattam
2003-02-14 1:29 ` Andi Kleen
2003-02-14 1:51 ` Eric Northup
2003-02-14 2:01 ` Peter Tattam
2003-02-14 4:07 ` Thomas J. Merritt
2003-02-14 9:38 ` Peter Finderup Lund
2003-02-14 8:27 ` Eric W. Biederman
2003-03-19 1:22 ` Rob Landley
2003-02-12 4:18 ` Jamie Lokier
2003-02-12 5:54 ` Linus Torvalds
2003-02-12 10:18 ` Jamie Lokier
2003-02-12 17:24 ` Linus Torvalds
2003-03-18 15:24 ` Kevin Pedretti [this message]
2003-03-18 16:41 ` Linus Torvalds
2003-03-18 18:30 ` Brian Gerst
2003-03-18 19:14 ` Thomas Molina
2003-03-18 19:21 ` Linus Torvalds
2003-03-18 20:03 ` Thomas Schlichter
2003-03-18 20:24 ` Steven Cole
2003-03-19 0:42 ` H. Peter Anvin
2003-03-19 2:22 ` george anzinger
[not found] <20030318165013$55f4@gated-at.bofh.it>
[not found] ` <20030318184010$6448@gated-at.bofh.it>
2003-03-18 20:19 ` Pascal Schmidt
-- strict thread matches above, loose matches on Subject: below --
2003-03-19 9:55 Ph. Marek
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=3E773A39.2090403@sandia.gov \
--to=ktpedre@sandia.gov \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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