From: Luca Barbieri <ldb@ldb.ods.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "J.A. Magallon" <jamagallon@able.es>,
Linux-Kernel ML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [RFC] [2.5 i386] GCC 3.1 -march support, PPRO_FENCE reduction, prefetch fixes and other CPU-related changes
Date: 05 Aug 2002 11:31:17 +0200 [thread overview]
Message-ID: <1028539877.1572.108.camel@ldb> (raw)
In-Reply-To: <1028540954.16550.26.camel@irongate.swansea.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]
On Mon, 2002-08-05 at 11:49, Alan Cox wrote:
> On Mon, 2002-08-05 at 09:12, Luca Barbieri wrote:
> > So I'm only replacing the lock; addl $0,0(%%esp) with the Xfence
> > instructions which are more efficient.
>
> The original code has rmb not doing any kind of CPU operation, and wmb
> likewise. (Quoting 2.4 and 2.5.29 here)
No. As you quote below, it does a lock addl which is a serializing
operation.
lfence is the same but doesn't serialize write operations and is
probably more efficient since it is designed for the purpose of
serializing load operations.
mfence is like lfence but also serializes writes.
However I don't have a Pentium 4 so I haven't done any checking or
benchmarks.
> You don't need stronger barriers except on the Pentium Pro or the
> Winchip because of the guarantees already made by the processor and by
> the PCI interface.
>
> The only case you need a store fence with non buggy/weird processors is
> when you do non temporal stores. In that situation the barriers are
> still not needed because the non temporal using functions already have
> their own sfence instructions and need them.
I agree and the patch only adds sfence _if_ CONFIG_X86_OOSTORE is
defined (and CONFIG_X86_MMXEXT is also defined).
>
> #define mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)":
> :"memory")
> #define rmb() mb()
>
> #ifdef CONFIG_X86_OOSTORE
> #define wmb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": :
> :"memory")
> #else
> #define wmb() __asm__ __volatile__ ("": : :"memory")
> #endif
>
>
> For the PPro a lock addl is the most efficient one I know of for working
> around the store order errata. If you want to optimise it further then
> the winchip appears to be fractionally faster using an rdmsr() but that
> impacts registers so wants more profiling
This isn't changed.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2002-08-05 9:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-04 14:27 [PATCH] [RFC] [2.5 i386] GCC 3.1 -march support, PPRO_FENCE reduction, prefetch fixes and other CPU-related changes Luca Barbieri
2002-08-04 14:36 ` Thunder from the hill
2002-08-04 15:32 ` Sebastian Droege
2002-08-04 15:43 ` Luca Barbieri
2002-08-04 15:50 ` Alan Cox
2002-08-04 14:44 ` Luca Barbieri
2002-08-04 18:59 ` J.A. Magallon
2002-08-04 20:23 ` Luca Barbieri
2002-08-04 21:51 ` Alan Cox
2002-08-04 21:54 ` Alan Cox
2002-08-04 20:43 ` Luca Barbieri
2002-08-05 0:02 ` Alan Cox
2002-08-05 8:12 ` Luca Barbieri
2002-08-05 9:49 ` Alan Cox
2002-08-05 9:31 ` Luca Barbieri [this message]
2002-08-05 11:05 ` Alan Cox
2002-08-05 9:53 ` Luca Barbieri
2002-08-05 11:26 ` 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=1028539877.1572.108.camel@ldb \
--to=ldb@ldb.ods.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jamagallon@able.es \
--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