From: Dave Jones <davej@suse.de>
To: Ruth Ivimey-Cook <Ruth.Ivimey-Cook@ivimey.org>
Cc: Luigi Genoni <kernel@Expansa.sns.it>,
"J.A. Magallon" <jamagallon@able.es>,
Luca Barbieri <ldb@ldb.ods.org>,
Marcelo Tosatti <marcelo@conectiva.com.br>,
Linux-Kernel ML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [2.4] [2.5] [i386] Add support for GCC 3.1 -march=pentium{-mmx,3,4}
Date: Sun, 26 May 2002 02:30:10 +0200 [thread overview]
Message-ID: <20020526023009.G16102@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0205260128110.2047-100000@Expansa.sns.it> <Pine.LNX.4.44.0205260044270.10923-100000@sharra.ivimey.org>
On Sun, May 26, 2002 at 12:49:57AM +0100, Ruth Ivimey-Cook wrote:
> For the CONFIG_<<cputype>> options, is it only gcc compiler-type settings that
> are affected? I thought the assembly parts of the kernel were also switched on
> occasion.
Typically the MMX/3dnow/SSE memory copies get enabled where possible.
> I was wondering whether anyone has checked that these assembly snippets were
> decently optimal for the cpu type selected...
Arjan and a few others spent weeks tuning the memset/memcpy functions,
there's really not that much room for improvement with them imo.
I spent a week or so a while back trying in vain to squeeze out just a
few more MB/s, and failed to get good results across the board.
There are a few tricks that can be pulled to do things like copying
backwards to trick hardware prefetchers, but this starts to get into
voodoo land.
For now, the i386 optimised memcpy is probably a closed book.
x86-64 may reopen that book to revisit some lessons learned..
> > > In a lot of cases, the kernel 'knows better' and is adding the
> Be careful about 'knowing better' than compilers. I really don't want to start
> a flamefest, but modern compilers are very good at doing all sorts of
> optimisations, and hand-coded 'optimisations' can _sometimes_ actually hurt
> performance over the unadorned version of the code.
I would be (pleasantly) surprised to see gcc turn a C memcpy into faster
assembly than our current implementation. And I'll bet
$beverage_of_choice it'll stay that way for some time.
gcc has come on in leaps and bounds, but for something as performance
critical as memory copying/clearing, hand tuned assembly wins hands down.
Even AMD's/Intel's performance guides suggest doing this. It's the only
way to fly.
Dave.
--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs
next prev parent reply other threads:[~2002-05-26 0:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-25 21:01 [PATCH] [2.4] [2.5] [i386] Add support for GCC 3.1 -march=pentium{-mmx,3,4} Luca Barbieri
2002-05-25 23:37 ` J.A. Magallon
2002-05-25 22:53 ` Dave Jones
2002-05-25 23:29 ` Luigi Genoni
2002-05-25 23:49 ` Ruth Ivimey-Cook
2002-05-26 0:30 ` Dave Jones [this message]
2002-05-27 8:53 ` Pavel Machek
2002-05-29 11:42 ` Dave Jones
2002-05-29 19:57 ` Pavel Machek
2002-05-30 6:40 ` Jan Hubicka
2002-05-30 10:25 ` David Woodhouse
2002-05-30 10:45 ` Jan Hubicka
2002-05-26 1:08 ` J.A. Magallon
2002-05-26 0:21 ` Dave Jones
[not found] ` <1022380785.11859.59.camel@irongate.swansea.linux.org.uk>
2002-05-26 9:11 ` J.A. Magallon
2002-05-26 19:14 ` Alan Cox
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=20020526023009.G16102@suse.de \
--to=davej@suse.de \
--cc=Ruth.Ivimey-Cook@ivimey.org \
--cc=jamagallon@able.es \
--cc=kernel@Expansa.sns.it \
--cc=ldb@ldb.ods.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/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