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 10:12:06 +0200 [thread overview]
Message-ID: <1028535126.1572.48.camel@ldb> (raw)
In-Reply-To: <1028505732.15495.38.camel@irongate.swansea.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1413 bytes --]
> I'm trying to understand why you think they are needed at all. Except
> for code that specifically does non-temporal we don't need fences on an
> X86, and the code that uses non temporal stores has its own fences built
> in.
>
> So as far as I can see the only cases we ever have to care about are
>
> PPro - processor bug
> IDT Winchip - because we run it in oostore module not strict x86 mode
>
> I don't see why you are generating extra fence instructions for other
> cases
>
__volatile__ and : : :"memory" omitted from asm statements
Both without and with patch:
- barrier(): asm("")
Without patch:
- mb(): asm("lock; addl $0,0(%%esp)")
- rmb(): asm("lock; addl $0,0(%%esp)")
- wmb: if(OOSTORE) asm("lock; addl $0,0(%%esp)") else barrier()
With patch:
- mb(): if(SSE2) asm("mfence") else asm("lock; addl $0,0(%%esp)")
- rmb(): if(SSE2) asm("lfence") else asm("lock; addl $0,0(%%esp)")
- wmb: if(OOSTORE) {if(MMXEXT) asm("sfence") else asm("lock; addl
$0,0(%%esp)")} else barrier()
So I'm only replacing the lock; addl $0,0(%%esp) with the Xfence
instructions which are more efficient.
As for the need for fences, based on the Intel documentation it seems
that we need read fences to read all hardware locations not mapped as
uncacheable and write fences for all memory locations mapped as write
combining.
Since drivers often map cacheable memory and then use rmb(), rmb()
cannot be made a nop.
[-- 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 8:10 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 [this message]
2002-08-05 9:49 ` Alan Cox
2002-08-05 9:31 ` Luca Barbieri
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=1028535126.1572.48.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