Re: bit fields && data tearing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: bit fields && data tearing
- From: "H. Peter Anvin" <hpa@xxxxxxxxx>
- Date: Mon, 08 Sep 2014 19:30:29 -0700
- Cc: paulmck@xxxxxxxxxxxxxxxxxx, Peter Hurley <peter@xxxxxxxxxxxxxxxxxx>, One Thousand Gnomes <gnomes@xxxxxxxxxxxxxxxxxxx>, Jakub Jelinek <jakub@xxxxxxxxxx>, Mikael Pettersson <mikpelinux@xxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Richard Henderson <rth@xxxxxxxxxxx>, Oleg Nesterov <oleg@xxxxxxxxxx>, Miroslav Franc <mfranc@xxxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, Tony Luck <tony.luck@xxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx
- In-reply-to: <1410215994.2027.86.camel@jarvis.lan>
- List-id: <linux-ia64.vger.kernel.org>
- References: <5408C0AB.6050801@hurleysoftware.com> <20140905001751.GL5001@linux.vnet.ibm.com> <1409883098.5078.14.camel@jarvis.lan> <5409243C.4080704@hurleysoftware.com> <20140905040645.GO5001@linux.vnet.ibm.com> <1410066442.12512.13.camel@jarvis.lan> <20140907162146.GK5001@linux.vnet.ibm.com> <1410116687.2027.19.camel@jarvis.lan> <20140907230019.GO5001@linux.vnet.ibm.com> <6092b453-e0c9-4f6d-922b-48bce988f774@email.android.com> <20140907233655.GR5001@linux.vnet.ibm.com> <154b540a-df47-4f3e-bdda-ab5d2e72723a@email.android.com> <1410155802.2027.36.camel@jarvis.lan> <540DF17C.9080509@zytor.com> <1410203369.2027.56.camel@jarvis.lan> <540DFFB2.4000509@zytor.com> <1410215994.2027.86.camel@jarvis.lan>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0
On 09/08/2014 03:39 PM, James Bottomley wrote:
>
> I don't understand what you mean by "pass each other". Atomicity
> guarantees are not ordering guarantees in a SMP environment. The
> guarantee is that if you follow the rules when two CPUs update the same
> natural width aligned object simultaneously using the same primitive,
> the result is either one or the other of their updates. Which one wins
> (the ordering) isn't defined.
>
I'm trying to figure out why it would possibly make a difference in any
kind of sane system if gcc fuses accesses.
Assuming bigendian for the moment, I would expect that if CPU 1 does a
write of 0x01020304 to address 0 and CPU 2 does a write of 0x0506 to
address 2, that the end result would be either 0x01020304 or 0x01020506.
Similarly, I would expect that if these operations are both done on the
same CPU in that order, that the result would unambiguously be 0x01020506.
I would strongly suspect an architecture which does not provide those
guarantees is an outlier.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]