public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: David Howells <dhowells@redhat.com>
Cc: torvalds@osdl.org, akpm@osdl.org, mingo@redhat.com,
	alan@redhat.com, linux-arch@vger.kernel.org,
	linuxppc64-dev@ozlabs.org, linux-kernel@vger.kernel.org,
	"Paul E. McKenney" <paulmck@us.ibm.com>
Subject: Re: [PATCH] Document Linux's memory barriers [try #4]
Date: Wed, 15 Mar 2006 22:51:30 +1100	[thread overview]
Message-ID: <4417FFC2.8040909@yahoo.com.au> (raw)
In-Reply-To: <14886.1142421018@warthog.cambridge.redhat.com>

David Howells wrote:
> Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> 
> 
>>Isn't the Alpha's split caches a counter-example of your model,
>>because the coherency itself is out of order?
> 
> 
> I'd forgotten I need to adjust my documentation to deal with this. It seems
> this is the reason for read_barrier_depends(), and that read_barrier_depends()
> is also a partial cache sync.
> 
> Do you know of any docs on Alpha's split caches? The Alpha Arch Handbook
> doesn't say very much about cache operation on the Alpha.
> 
> I've looked around for what exactly is meant by "split cache" in conjunction
> with Alpha CPUs, and I've found three different opinions of what it means:
> 
>  (1) Separate Data and Instruction caches.
> 
>  (2) Serial data caches (CPU -> L1 Cache -> L2 Cache -> L3 Cache -> Memory).
> 
>  (3) Parallel linked data caches, where a CPU's request can be satisfied by
>      either data cache, in which whilst one data cache is being interrogated by
>      the CPU, the other one can use the memory bus (at least, that's what I
>      understand).
> 

I don't have any docs myself, Paul might be the one to talk to as he's
done the most recent research on this (though some of it directly with
Alpha engineers, if I remember correctly).

IIRC some alpha models have split cache close to what you describe in
#3, however I'm not sure of the fine details (eg. I don't think the
split caches are redundant, but just treated as two entities by the
cache coherence protocol).

Again, I don't have anything definitive that you can put in your docco,
sorry.

> 
>>Why do you need to include caches and queues in your model? Do
>>programmers care? Isn't the following sufficient...
> 
> 
> I don't think it is sufficient, given the number of times the way the cache
> interacts with everything has come up in this discussion.
> 
> 
>>         :    | m |
>>   CPU -----> | e |
>>         :    | m |
>>         :    | o |
>>   CPU -----> | r |
>>         :    | y |
>>
>>... and bugger the implementation details?
> 
> 
> Ah, but if the cache is on the CPU side of the dotted line, does that then mean
> that a write memory barrier guarantees the CPU's cache to have updated memory?
> 

I don't think it has to[*]. It would guarantee the _order_ in which
"global memory" of this model ie. visibility for other "CPUs" see the
writes, whether that visibility ultimately be implemented by cache
coherency protocol or something else, I don't think matters (for a
discussion of memory ordering). If anything it confused the matter
for the case of Alpha.

All the programmer needs to know is that there is some horizon (memory)
beyond which stores are visible to other CPUs, and stores can travel
there at different speeds so later ones can overtake earlier ones. And
likewise loads can come from memory to the CPU at different speeds too,
so later loads can contain earlier results.

[*] Nor would your model require a smp_wmb() to update CPU caches either,
I think: it wouldn't have to flush the store buffer, just order it.

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

  reply	other threads:[~2006-03-15 11:58 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-09 20:29 [PATCH] Document Linux's memory barriers [try #4] David Howells
2006-03-09 23:34 ` Paul Mackerras
2006-03-09 23:45   ` Michael Buesch
2006-03-09 23:56     ` Linus Torvalds
2006-03-10  0:07       ` Michael Buesch
2006-03-10  0:48   ` Alan Cox
2006-03-10  0:54     ` Paul Mackerras
2006-03-10 15:19   ` David Howells
2006-03-11  0:01     ` Paul Mackerras
2006-03-10  5:28 ` Nick Piggin
2006-03-15 11:10   ` David Howells
2006-03-15 11:51     ` Nick Piggin [this message]
2006-03-15 13:47       ` David Howells
2006-03-15 23:21         ` Nick Piggin
2006-03-12 17:15 ` Eric W. Biederman
2006-03-14 21:26   ` David Howells
2006-03-14 21:48     ` Paul Mackerras
2006-03-14 23:59       ` David Howells
2006-03-15  0:20         ` Linus Torvalds
2006-03-15  1:19           ` David Howells
2006-03-15  1:47             ` Linus Torvalds
2006-03-15  1:25           ` Nick Piggin
2006-03-15  0:54         ` Paul Mackerras
2006-03-13 12:32 ` Sergei Organov
2006-03-14 20:31   ` David Howells
2006-03-14 21:11     ` linux-os (Dick Johnson)
2006-03-15  9:09       ` Sergei Organov
2006-03-15  9:04     ` Sergei Organov
2006-03-14 20:35   ` David Howells
2006-03-15  9:11     ` Sergei Organov
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=4417FFC2.8040909@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=alan@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@ozlabs.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@us.ibm.com \
    --cc=torvalds@osdl.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