From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86 bitops.h commentary on instruction reordering
Date: Sat, 07 Aug 2004 23:16:06 +0100 [thread overview]
Message-ID: <1091916965.19077.31.camel@localhost.localdomain> (raw)
In-Reply-To: <cf10v3$h9l$1@terminus.zytor.com>
On Gwe, 2004-08-06 at 23:33, H. Peter Anvin wrote:
> > > So, there is no platform independent way for doing that in the kernel?
> > Not really. x86 doesnt have such an instruction.
> Actually it does (sfence, lfence, mfence); they only apply to SSE
> loads and stores since all other x86 operations are guaranteed to be
> strictly ordered.
The ordering guarantees on x86 are not completely strict and they refer
to the observed order of store on the bus rather than execution order.
So while code will generate the same observable results as if it was in
order you can get burned on timing suprises in some odd cases. Some of
the devices will even do weakly ordered stores to memory and fix up the
bus transactions by snooping them and spotting the impending problem.
Secondly on PPro and some others there are various chip errata where not
using locking operations _does_ cause observable out of order stores.
Thats why our unlock path for PPro uses lock movb.
Also for pedants only we support IDT Winchips (ancestor of the VIA C3)
which we do run with weak store ordering from an external view (not an
internal one). On those x86 variants the barrier instructions do what
you would expect.
Alan
next prev parent reply other threads:[~2004-08-07 23:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-05 20:06 [PATCH] x86 bitops.h commentary on instruction reordering Marcelo Tosatti
2004-08-06 14:17 ` Vladislav Bolkhovitin
2004-08-06 14:33 ` Marcelo Tosatti
2004-08-06 15:36 ` Vladislav Bolkhovitin
2004-08-06 15:53 ` Marcelo Tosatti
2004-08-06 16:52 ` Vladislav Bolkhovitin
2004-08-06 17:09 ` Marcelo Tosatti
2004-08-06 22:33 ` H. Peter Anvin
2004-08-07 1:01 ` Zwane Mwaikambo
2004-08-07 22:16 ` Alan Cox [this message]
2004-08-09 15:14 ` Vladislav Bolkhovitin
2004-08-09 15:50 ` Marcelo Tosatti
2004-08-09 17:35 ` Vladislav Bolkhovitin
[not found] ` <20040809183437.GD6361@logos.cnet>
2004-08-09 20:12 ` Vladislav Bolkhovitin
2004-08-09 21:21 ` Alan Cox
2004-08-10 12:28 ` Vladislav Bolkhovitin
2004-08-09 11:58 ` Maciej W. Rozycki
[not found] <2pY7Y-W1-7@gated-at.bofh.it>
[not found] ` <2qdJL-3sh-27@gated-at.bofh.it>
[not found] ` <2qePx-4eM-21@gated-at.bofh.it>
[not found] ` <2qf8S-4pI-31@gated-at.bofh.it>
[not found] ` <2qg4V-54c-17@gated-at.bofh.it>
[not found] ` <2qgoh-5og-29@gated-at.bofh.it>
[not found] ` <2qhkn-649-41@gated-at.bofh.it>
[not found] ` <2rkgh-zP-45@gated-at.bofh.it>
[not found] ` <2rlFk-1wC-27@gated-at.bofh.it>
[not found] ` <2rmhX-20I-17@gated-at.bofh.it>
[not found] ` <2roWw-40d-19@gated-at.bofh.it>
[not found] ` <2roWw-40d-17@gated-at.bofh.it>
2004-08-09 21:23 ` Andi Kleen
2004-08-10 12:26 ` Vladislav Bolkhovitin
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=1091916965.19077.31.camel@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=hpa@zytor.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