public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Suzanne Wood <suzannew@cs.pdx.edu>
Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org, paulmck@us.ibm.com
Subject: Re: [PATCH] Document Linux's memory barriers [try #5]
Date: Wed, 29 Mar 2006 18:54:05 +0100	[thread overview]
Message-ID: <21401.1143654845@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <200603282225.k2SMP6kb023905@baham.cs.pdx.edu>

Suzanne Wood <suzannew@cs.pdx.edu> wrote:

> Seems like the subject of "will never happen" is the read from memory for the 
> asmt to X, but does that sentence say that?  

"asmt"?

I agree that it doesn't make much sense, so how's this instead?

+ However, it is guaranteed that a CPU will be self-consistent: it will see its
+ _own_ accesses appear to be correctly ordered, without the need for a memory
+ barrier.  For instance with the following code:
+ 
+ 	X = *A;
+ 	*A = Y;
+ 	Z = *A;
+ 
+ and assuming no intervention by an external influence, it can be taken that:
+ 
+  (*) X will end up holding the original value of *A, as
+ 
+  (*) the load of X from *A will never happen after the store of Y into *A, and
+      thus
+ 
+  (*) X will never be given instead the value that was assigned from Y to *A;
+      and
+ 
+  (*) Z will always be given the value in *A that was assigned there from Y, as
+ 
+  (*) the load of Z from *A will never happen before the store, and thus
+ 
+  (*) Z will never be given instead the value that was in *A initially.
+ 
+ (This ignores the fact that the value initially in *A may appear to be the same
+ as the value assigned to *A from Y).

I'm not sure I want to split the points up that way, but it does make them
clearer.  I'm not sure that method of linking them works, since it looks like
a bunch of incomplete statements.

Really, this should be described mathematically, if at all.

> It seems to require more effort than necessary to understand in regard to
> all that is presented in this document.

Are you referring to my attempt to define a self-consistent CPU?  Or to the
subject in general?

If the former, you may be right.  I'll look at compressing the whole thing
down to a single paragraph.

David

  reply	other threads:[~2006-03-29 17:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-28 22:25 [PATCH] Document Linux's memory barriers [try #5] Suzanne Wood
2006-03-29 17:54 ` David Howells [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-03-31 16:16 Suzanne Wood
2006-03-31  0:55 Suzanne Wood
2006-03-31 14:51 ` David Howells
2006-03-29 20:51 Suzanne Wood
2006-03-30 20:18 ` David Howells
2006-03-09 20:29 [PATCH] Document Linux's memory barriers [try #4] David Howells
2006-03-15 14:23 ` [PATCH] Document Linux's memory barriers [try #5] David Howells
     [not found]   ` <20060315200956.4a9e2cb3.akpm@osdl.org>
2006-03-16 11:50     ` David Howells
2006-03-16 17:18       ` Linus Torvalds
2006-03-17  1:20         ` Nick Piggin
2006-03-16 23:17   ` Paul E. McKenney
2006-03-16 23:55     ` Linus Torvalds
2006-03-17  1:29       ` Paul E. McKenney
2006-03-17  5:32         ` Linus Torvalds
2006-03-17  6:23           ` Paul E. McKenney
2006-03-23 18:34     ` David Howells
2006-03-23 19:28       ` Linus Torvalds
2006-03-23 22:26       ` Paul E. McKenney

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=21401.1143654845@warthog.cambridge.redhat.com \
    --to=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@us.ibm.com \
    --cc=suzannew@cs.pdx.edu \
    /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