Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Historical Question on Alpha 21064
@ 2001-05-24 16:10 McCalpin
  2001-05-24 18:40 ` David desJardins
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: McCalpin @ 2001-05-24 16:10 UTC (permalink / raw)


The Alpha 21064 (EV4) processor has a write-through,
non-allocating Data cache, supported by four line-sized
write buffers.

So if a store misses in the cache, the line is not read
into the cache, and the stores are gathered into the
store buffer.

There are two obvious ways to maintain coherency here:
1. allocate the line into the store buffer and update
   the single master copy there, or
2. merge the contents of the store buffer with memory
   when it comes time to flush the store buffer.

The former approach burns memory bandwidth to load 
the store buffer.

The latter approach requires partial line writes to
memory in cases where the buffer is flushed without 
being completely filled.  I consider partial line writes
to memory to be exceedingly ugly.

Does anyone know what technique the 21064 actually used
to maintain coherency on stores?
-- 
John D. McCalpin, Ph.D.           mccalpin@austin.ibm.com
Senior Technical Staff Member     IBM POWER Microprocessor Development
    "I am willing to make mistakes as long as
     someone else is willing to learn from them."


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 16:10 Historical Question on Alpha 21064 McCalpin
@ 2001-05-24 18:40 ` David desJardins
  2001-05-24 18:45 ` Eric C. Fromm
  2001-05-24 21:02 ` Paul DeMone
  2 siblings, 0 replies; 25+ messages in thread
From: David desJardins @ 2001-05-24 18:40 UTC (permalink / raw)


"John D. McCalpin, Ph.D." <mccalpin@gmp246.austin.ibm.com> writes:
> The latter approach requires partial line writes to memory in cases
> where the buffer is flushed without being completely filled.  I
> consider partial line writes to memory to be exceedingly ugly.

The 21064 used a mask to write only the data that's actually in the
write buffer.  I don't know why this is "ugly".  Also, since it had a
128-bit bus and 32-byte cache lines, if all of the data to be written
happened to be in the first 16 bytes, it could truncate the protocol
before the second bus cycle to save time.  I wrote some code that used
only memory locations congruent to {0,1} mod 4, to take advantage of this.

                                        David desJardins


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 16:10 Historical Question on Alpha 21064 McCalpin
  2001-05-24 18:40 ` David desJardins
@ 2001-05-24 18:45 ` Eric C. Fromm
  2001-05-24 20:04   ` McCalpin
  2001-05-24 21:02 ` Paul DeMone
  2 siblings, 1 reply; 25+ messages in thread
From: Eric C. Fromm @ 2001-05-24 18:45 UTC (permalink / raw)


McCalpin wrote:
> 
> The Alpha 21064 (EV4) processor has a write-through,
> non-allocating Data cache, supported by four line-sized
> write buffers.
> 
> So if a store misses in the cache, the line is not read
> into the cache, and the stores are gathered into the
> store buffer.
> 
> There are two obvious ways to maintain coherency here:
> 1. allocate the line into the store buffer and update
>    the single master copy there, or
> 2. merge the contents of the store buffer with memory
>    when it comes time to flush the store buffer.
> 
> The former approach burns memory bandwidth to load
> the store buffer.
> 
> The latter approach requires partial line writes to
> memory in cases where the buffer is flushed without
> being completely filled.  I consider partial line writes
> to memory to be exceedingly ugly.

I can't answer with certainty. Unfortunately, I tossed my
EV4 docs recently. But I'm fairly certain partial writes
was the solution. On the other hand, what is it about
partial writes that seems so ugly in this context?

thanks,

-eric

-- 
Eric C. Fromm                           efromm@sgi.com
Principal Engineer                      Scalable Systems Division
SGI - Silicon Graphics, Inc.            Chippewa Falls, Wi.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 18:45 ` Eric C. Fromm
@ 2001-05-24 20:04   ` McCalpin
  2001-05-24 20:36     ` David desJardins
                       ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: McCalpin @ 2001-05-24 20:04 UTC (permalink / raw)


In article <3B0D56B1.A91BE4A1@sgi.com>, Eric C. Fromm <efromm@sgi.com> wrote:
>McCalpin wrote:
>> 
>> The Alpha 21064 (EV4) processor has a write-through,
>> non-allocating Data cache, supported by four line-sized
>> write buffers.
>> 
>> So if a store misses in the cache, the line is not read
>> into the cache, and the stores are gathered into the
>> store buffer.
>> 
>> There are two obvious ways to maintain coherency here:
>> 1. allocate the line into the store buffer and update
>>    the single master copy there, or
>> 2. merge the contents of the store buffer with memory
>>    when it comes time to flush the store buffer.
>> 
>> The latter approach requires partial line writes to
>> memory in cases where the buffer is flushed without
>> being completely filled.  I consider partial line writes
>> to memory to be exceedingly ugly.
>
>I can't answer with certainty. Unfortunately, I tossed my
>EV4 docs recently. But I'm fairly certain partial writes
>was the solution. On the other hand, what is it about
>partial writes that seems so ugly in this context?

Partial writes are ugly for many reasons:

1. They may require lots of partial writes if (as is most
   reasonable) the merge function in the memory can only
   write contiguous fields.
   For example, a 128 Byte store buffer that has every
   other byte written either needs the memory controller
   merge function to support byte masks (yechh!) or it
   needs to make 64 partial writes (double yechh!).

2. Unmerged data is really ugly in MP machines.  If a 
   store buffer is partially filled and generates a snoop
   hit for another processor's load, you probably need 
   to do the partial writes back to memory, merge the data
   there, and then satisfy the load from memory.  This 
   makes interventions really slow.  You probably can't
   give the partial data to the other process, since its
   data cache does not support byte enables.  You could
   (in theory) transfer the data with the byte enables
   to the other processor's store buffer, but this is also
   ugly, since it would likely evict a real store that was
   trying to gather there.  This would also be a bad idea
   if the load was due to an Icache miss, since the Icache
   generally has to take the data in a shared state.
   There are a couple of extra possibilities, I suppose....
   The processor executing the load could get data from both
   memory and the processor that had it dirty, and could do
   the merge itself.  Or the source processor could allocate
   the data, do the merge, and service the load.  

   All of these approaches are exceedingly complex compared
   to the simple approach of loading the data from memory
   into the store buffer and maintaining the master copy
   of all of the bytes in the line in the store buffer.
-- 
John D. McCalpin, Ph.D.           mccalpin@austin.ibm.com
Senior Technical Staff Member     IBM POWER Microprocessor Development
    "I am willing to make mistakes as long as
     someone else is willing to learn from them."


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 20:04   ` McCalpin
@ 2001-05-24 20:36     ` David desJardins
  2001-05-24 23:06       ` McCalpin
  2001-05-25  8:57     ` Anton Ertl
  2001-05-26 11:25     ` Jonathan Thornburg
  2 siblings, 1 reply; 25+ messages in thread
From: David desJardins @ 2001-05-24 20:36 UTC (permalink / raw)


"John D. McCalpin, Ph.D." <mccalpin@austin.ibm.com> writes:
> 1. They may require lots of partial writes if (as is most reasonable)
> the merge function in the memory can only write contiguous fields.
> For example, a 128 Byte store buffer that has every other byte written
> either needs the memory controller merge function to support byte
> masks (yechh!) or it needs to make 64 partial writes (double yechh!).

As you probably know, the 21064 only does memory I/O in 8-byte words, so
this is a non-issue.

> All of these approaches are exceedingly complex compared
> to the simple approach of loading the data from memory
> into the store buffer and maintaining the master copy
> of all of the bytes in the line in the store buffer.

That may be simple, but it's disastrously slow for many applications.
Fast beats simple any day.

Write-allocate systems just suck.

                                        David desJardins


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 16:10 Historical Question on Alpha 21064 McCalpin
  2001-05-24 18:40 ` David desJardins
  2001-05-24 18:45 ` Eric C. Fromm
@ 2001-05-24 21:02 ` Paul DeMone
  2 siblings, 0 replies; 25+ messages in thread
From: Paul DeMone @ 2001-05-24 21:02 UTC (permalink / raw)




McCalpin wrote:
[...]

> Does anyone know what technique the 21064 actually used
> to maintain coherency on stores?

#2 - A load miss that hits an address in the write buffer
cause the write buffer to be flushed completely regardless
of which buffer entry matches the address.

(from DECchip 21064-AA hardware reference manual)

--
Paul W. DeMone       The 801 experiment SPARCed an ARMs race of EPIC
Kanata, Ontario      proportions to put more PRECISION and POWER into
demone@mosaid.com    architectures with MIPSed results but ALPHA's well
pdemone@igs.net      that ends well.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 20:36     ` David desJardins
@ 2001-05-24 23:06       ` McCalpin
  2001-05-24 23:54         ` David desJardins
  0 siblings, 1 reply; 25+ messages in thread
From: McCalpin @ 2001-05-24 23:06 UTC (permalink / raw)


In article <voh66eqcwmw.fsf@math.berkeley.edu>,
David desJardins  <david@desjardins.org> wrote:
>"John D. McCalpin, Ph.D." <mccalpin@austin.ibm.com> writes:
>> 1. They may require lots of partial writes if (as is most reasonable)
>> the merge function in the memory can only write contiguous fields.
>> For example, a 128 Byte store buffer that has every other byte written
>> either needs the memory controller merge function to support byte
>> masks (yechh!) or it needs to make 64 partial writes (double yechh!).
>
>As you probably know, the 21064 only does memory I/O in 8-byte words, so
>this is a non-issue.

Not correct.  The 21064 does memory I/O in 32 Byte cache lines.
Within the cache line, loads and stores operate on 8 Byte quantities,
so there are still four distinct entities in the store buffer that
must be kept track of and merged correctly.



>> All of these approaches are exceedingly complex compared
>> to the simple approach of loading the data from memory
>> into the store buffer and maintaining the master copy
>> of all of the bytes in the line in the store buffer.
>
>That may be simple, but it's disastrously slow for many applications.

Write allocates are not "disastrously" slow on *any* applications.

"Disastrously slow" connotes slowdowns of orders of magnitude, 
while write allocation is unable to provide a slowdown of more than
a factor of two on even the most perverse applications.  The benchmark
that I won't name sits at the top of a very short list of codes 
where the difference in performance is large enough to be irritating....

Write allocates have minimal impact on the overwhelming majority
of commercially important applications in science and engineering
and actually improve performance on many algorithms.  Using write
allocates also makes it possible to do fast cache-to-cache interventions
that help synchronization primitives and tightly coupled producer/consumer
algorithms.




>Fast beats simple any day.

This is demonstrably incorrect.  For example, Alpha processors have
had performance at or near the leading edge for most of the past
five years or so, and yet Compaq only has about a 22% market share in
the HPC market (CY2000 results as reported by IDC).

How about "working correctly beats not working correctly any day"?


>Write-allocate systems just suck.

I am not happy with them, but the complexity of doing anything else
(that still maintains the nice performance characteristics that 
write allocates have on many algorithms) is daunting.  

Remember that a 3 month schedule slip (about enough to do one more
tapeout to fix a processor bug) typically eliminates about 25% of
the lifetime revenue obtained by a computer system.  Part of this is
the Moore's Law slip, and part is the long-term effect of launching
a less competitive product (thereby acquiring less market share early
in the product lifetime).   With those sorts of penalties for error,
risky things like separate prefetch buffers and complex store merging
hardware are extremely difficult to justify.
-- 
John D. McCalpin, Ph.D.           mccalpin@austin.ibm.com
Senior Technical Staff Member     IBM POWER Microprocessor Development
    "I am willing to make mistakes as long as
     someone else is willing to learn from them."


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 23:06       ` McCalpin
@ 2001-05-24 23:54         ` David desJardins
  2001-05-25 23:11           ` Jay R. Ashworth
                             ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: David desJardins @ 2001-05-24 23:54 UTC (permalink / raw)


"John D. McCalpin, Ph.D." <mccalpin@austin.ibm.com> writes:
> Not correct.  The 21064 does memory I/O in 32 Byte cache lines.
> Within the cache line, loads and stores operate on 8 Byte quantities,

This is exactly the same as my supposedly "not correct" statement.  As I
said, your putative example can't occur, because it's not possible for
some bytes in a word to be modified and not others.

> "Disastrously slow" connotes slowdowns of orders of magnitude, 
> while write allocation is unable to provide a slowdown of more than
> a factor of two on even the most perverse applications.

That turns out not to be the case; in fact, write-allocate can cost more
than a factor of two.  A write-allocate version of the 21064, which
would have to use two bus cycles to read each cache line and then two
more bus cycles to write the cache line, could easily be more than twice
as slow as the actual 21064, which can actually write a partial cache
line in only one bus cycle.  Write-allocate also makes it much more
likely that the processor will stall, by increasing the number of
outstanding memory accesses, unless additional hardware is added.

But a factor of two is bad enough for me.  You can concentrate on
creating bigger disasters, if you choose.

>> Fast beats simple any day.
> 
> This is demonstrably incorrect.  For example, Alpha processors have
> had performance at or near the leading edge for most of the past five
> years or so, and yet Compaq only has about a 22% market share in the
> HPC market (CY2000 results as reported by IDC).

The reason for that is certainly not that the competing processors are
simpler!  The Alpha processors are both faster and simpler than their
competitors.

                                        David desJardins


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 20:04   ` McCalpin
  2001-05-24 20:36     ` David desJardins
@ 2001-05-25  8:57     ` Anton Ertl
  2001-05-26 11:25     ` Jonathan Thornburg
  2 siblings, 0 replies; 25+ messages in thread
From: Anton Ertl @ 2001-05-25  8:57 UTC (permalink / raw)


In article <9ejpfu$l02$1@ausnews.austin.ibm.com>,
 mccalpin@gmp246.austin.ibm.com (McCalpin) writes:
>Partial writes are ugly for many reasons:
>
>1. They may require lots of partial writes if (as is most
>   reasonable) the merge function in the memory can only
>   write contiguous fields.
>   For example, a 128 Byte store buffer that has every
>   other byte written either needs the memory controller
>   merge function to support byte masks (yechh!) or it
>   needs to make 64 partial writes (double yechh!).

Well, the 21064 stores at least 4 bytes at a time (with stl), and it
only has 4 write buffers, so in this case it's not that bad.

Also, how often do such cases happen?  Maybe the programmer or the
compiler could do write allocation in software in such cases.

Having a write-through data cache in the first place is a much bigger
performance problem IMO.

>2. Unmerged data is really ugly in MP machines.

Was the 21064 used in (any kind of) shared-memory MP machine?

>  If a 
>   store buffer is partially filled and generates a snoop
>   hit for another processor's load, you probably need 
>   to do the partial writes back to memory, merge the data
>   there, and then satisfy the load from memory.  This 
>   makes interventions really slow.

Probably, but how often does this happen?

>  You probably can't
>   give the partial data to the other process, since its
>   data cache does not support byte enables.

It has to support partial writes at least for the stores from its own
CPU.

>  You could
>   (in theory) transfer the data with the byte enables
>   to the other processor's store buffer, but this is also
>   ugly, since it would likely evict a real store that was
>   trying to gather there.

Only if the store buffer is already full; if that happens a lot, maybe
its size should be increased (or better, use a write-back cache to
eliminate a large number of stores).

>  This would also be a bad idea
>   if the load was due to an Icache miss, since the Icache
>   generally has to take the data in a shared state.

One processor writing into code currently being used by another
processor, with the store and the icache miss overlapping by chance?
How often does this happen?  Also, the Alpha architecture (as most
others) requires that software keep the Icache consistent on stores
(with "call_pal imb"), so hardware can ignore this case.  On the 21064
this PAL-call is quite expensive (IIRC it flushes the whole I-cache in
some way), it happens much more frequently than the exceptional case
you mentioned, and it still is not known as a big performance problem.

Followups to comp.arch.

- anton
-- 
M. Anton Ertl                    Some things have to be seen to be believed
anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 23:54         ` David desJardins
@ 2001-05-25 23:11           ` Jay R. Ashworth
  2001-05-28 14:44           ` John McCalpin
  2001-05-29  8:45           ` Jan Vorbrueggen
  2 siblings, 0 replies; 25+ messages in thread
From: Jay R. Ashworth @ 2001-05-25 23:11 UTC (permalink / raw)


*Right* in the middle of the appendectomy, David desJardins turned
   to Hawkeye and me and said:
> That turns out not to be the case; in fact, write-allocate can cost more
> than a factor of two. 

"Is that the same as 'bullshit'?"

Cheers,
-- jra
-- 
Jay R. Ashworth                                                jra@baylink.com
Member of the Technical Staff     Baylink
The Suncoast Freenet         The Things I Think
Tampa Bay, Florida        http://baylink.pitas.com             +1 727 804 5015

   OS/X: Because making Unix user-friendly was easier than debugging Windows


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 20:04   ` McCalpin
  2001-05-24 20:36     ` David desJardins
  2001-05-25  8:57     ` Anton Ertl
@ 2001-05-26 11:25     ` Jonathan Thornburg
  2001-05-26 20:29       ` Terje Mathisen
  2001-05-29 20:01       ` Eric C. Fromm
  2 siblings, 2 replies; 25+ messages in thread
From: Jonathan Thornburg @ 2001-05-26 11:25 UTC (permalink / raw)


In article <9ejpfu$l02$1@ausnews.austin.ibm.com>,
McCalpin <mccalpin@austin.ibm.com> wrote:
>Partial writes are ugly for many reasons:
>
>1. They may require lots of partial writes if (as is most
>   reasonable) the merge function in the memory can only
>   write contiguous fields.
>   For example, a 128 Byte store buffer that has every
>   other byte written either needs the memory controller
>   merge function to support byte masks (yechh!) or it
>   needs to make 64 partial writes (double yechh!).

Hmm.  A naive programmer's view would say
* write 64 individual non-contiguous bytes
* write-through cache --> writes go to main memory
* expect 64 write transactions to memory
which is just about what happens.

-- 
-- Jonathan Thornburg <jthorn@thp.univie.ac.at>
   Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut),
   Golm, Germany             http://www.thp.univie.ac.at/~jthorn/home.html
    Only 6 countries in the world have the death penalty for children:
    Congo, Iran, Nigeria, (Pakistan[*]), Saudi Arabia, United States, Yemen
    [*] Pakistan reportedly ended it in July 2000. -- Amnesty International
                       http://www.web.amnesty.org/ai.nsf/index/AMR511392000 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-26 11:25     ` Jonathan Thornburg
@ 2001-05-26 20:29       ` Terje Mathisen
  2001-05-29 20:01       ` Eric C. Fromm
  1 sibling, 0 replies; 25+ messages in thread
From: Terje Mathisen @ 2001-05-26 20:29 UTC (permalink / raw)


Jonathan Thornburg wrote:
> 
> In article <9ejpfu$l02$1@ausnews.austin.ibm.com>,
> McCalpin <mccalpin@austin.ibm.com> wrote:
> >Partial writes are ugly for many reasons:
> >
> >1. They may require lots of partial writes if (as is most
> >   reasonable) the merge function in the memory can only
> >   write contiguous fields.
> >   For example, a 128 Byte store buffer that has every
> >   other byte written either needs the memory controller
> >   merge function to support byte masks (yechh!) or it
> >   needs to make 64 partial writes (double yechh!).
> 
> Hmm.  A naive programmer's view would say
> * write 64 individual non-contiguous bytes
> * write-through cache --> writes go to main memory
> * expect 64 write transactions to memory
> which is just about what happens.

OTOH, if you have byte-enable lines anyway, then it is very useful if
you also have a way to expose them to programmers, particularly for
stuff like transparency masks, where a masked write totally avoids the
(very costly) read from the frame buffer.

Yeah, I know that this is kids stuff for modern graphics chipsets, but
no matter how you set it up, you always get to the point where you have
to do some operations manually. :-(

Terje
-- 
- <Terje.Mathisen@hda.hydro.com>
Using self-discipline, see http://www.eiffel.com/discipline
"almost all programming can be viewed as an exercise in caching"


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-28 14:44           ` John McCalpin
@ 2001-05-28  5:03             ` Ben Franchuk
  2001-05-29  7:00               ` jmfbahciv
  2001-06-01 12:12               ` Carl Nelson
  2001-05-29  8:39             ` Jan Vorbrueggen
  1 sibling, 2 replies; 25+ messages in thread
From: Ben Franchuk @ 2001-05-28  5:03 UTC (permalink / raw)


John McCalpin wrote:

> OK, so in a particularly contrived example you think that the write
> allocate can cost a factor of four, or perhaps five if the bus loses
> an additional cycle on the turnaround.  I do have to wonder what sort
> of application only writes data and never reads anything from memory....

You do how ever often fill a block of memory with a  constant.

/ clear video buffer
  mov a,#SPACE
  mov x,#video
  mov c,#80*24
  repeat c: mov.b x++,a

-- 
"We do not inherit our time on this planet from our parents...
 We borrow it from our children."
"Luna family of Octal Computers" http://www.jetnet.ab.ca/users/bfranchuk
Updated - Now with schematics.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 23:54         ` David desJardins
  2001-05-25 23:11           ` Jay R. Ashworth
@ 2001-05-28 14:44           ` John McCalpin
  2001-05-28  5:03             ` Ben Franchuk
  2001-05-29  8:39             ` Jan Vorbrueggen
  2001-05-29  8:45           ` Jan Vorbrueggen
  2 siblings, 2 replies; 25+ messages in thread
From: John McCalpin @ 2001-05-28 14:44 UTC (permalink / raw)


David desJardins wrote:
> 
> "John D. McCalpin, Ph.D." <mccalpin@austin.ibm.com> writes:
> > Not correct.  The 21064 does memory I/O in 32 Byte cache lines.
> > Within the cache line, loads and stores operate on 8 Byte quantities,
> 
> This is exactly the same as my supposedly "not correct" statement.  As I
> said, your putative example can't occur, because it's not possible for
> some bytes in a word to be modified and not others.

My example was a more generic one concerning one implementation
difficulty of using store buffers with a non-allocating cache.
On the 21064, there are only 4 doublewords per cache line, so
it is not possible to have more than two fragments in a buffer.
In more common ISAs, significantly more complex cases can occur.



> > "Disastrously slow" connotes slowdowns of orders of magnitude,
> > while write allocation is unable to provide a slowdown of more than
> > a factor of two on even the most perverse applications.
> 
> That turns out not to be the case; in fact, write-allocate can cost more
> than a factor of two.  A write-allocate version of the 21064, which
> would have to use two bus cycles to read each cache line and then two
> more bus cycles to write the cache line, could easily be more than twice
> as slow as the actual 21064, which can actually write a partial cache
> line in only one bus cycle.  

OK, so in a particularly contrived example you think that the write 
allocate can cost a factor of four, or perhaps five if the bus loses
an additional cycle on the turnaround.  I do have to wonder what sort
of application only writes data and never reads anything from memory....

Hmmm, maybe you are not talking about a real application?



> But a factor of two is bad enough for me.  You can concentrate on
> creating bigger disasters, if you choose.

I would be happy to create bigger disasters.  Do you have any 
suggestions?


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-28  5:03             ` Ben Franchuk
@ 2001-05-29  7:00               ` jmfbahciv
  2001-06-01 12:12               ` Carl Nelson
  1 sibling, 0 replies; 25+ messages in thread
From: jmfbahciv @ 2001-05-29  7:00 UTC (permalink / raw)


In article <3B11DC3F.469BC299@jetnet.ab.ca>,
   Ben Franchuk <bfranchuk@jetnet.ab.ca> wrote:
>John McCalpin wrote:
>
>> OK, so in a particularly contrived example you think that the write
>> allocate can cost a factor of four, or perhaps five if the bus loses
>> an additional cycle on the turnaround.  I do have to wonder what sort
>> of application only writes data and never reads anything from memory....
>
>You do how ever often fill a block of memory with a  constant.
>
>/ clear video buffer
>  mov a,#SPACE
>  mov x,#video
>  mov c,#80*24
>  repeat c: mov.b x++,a
>
Which is often.  Hopefully, all requests for more memory
implies that the monitor zeroed it...especially the buffers
that are filled for writing to disk files.

/BAH

Subtract a hundred and four for e-mail.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-28 14:44           ` John McCalpin
  2001-05-28  5:03             ` Ben Franchuk
@ 2001-05-29  8:39             ` Jan Vorbrueggen
  1 sibling, 0 replies; 25+ messages in thread
From: Jan Vorbrueggen @ 2001-05-29  8:39 UTC (permalink / raw)


John McCalpin <jmccalpin@austin.rr.com> writes:

> On the 21064, there are only 4 doublewords per cache line, so
> it is not possible to have more than two fragments in a buffer.

In fact, even the first version of the Alpha architecture specified longword
(VAX speak for 4-byte entities) loads and stores - porting VMS would have been
extremely difficult without this. 

	Jan


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-24 23:54         ` David desJardins
  2001-05-25 23:11           ` Jay R. Ashworth
  2001-05-28 14:44           ` John McCalpin
@ 2001-05-29  8:45           ` Jan Vorbrueggen
  2001-05-29 17:36             ` David desJardins
  2 siblings, 1 reply; 25+ messages in thread
From: Jan Vorbrueggen @ 2001-05-29  8:45 UTC (permalink / raw)


David desJardins <desj@math.berkeley.edu> writes:

> That turns out not to be the case; in fact, write-allocate can cost more
> than a factor of two.  A write-allocate version of the 21064, which
> would have to use two bus cycles to read each cache line and then two
> more bus cycles to write the cache line, could easily be more than twice
> as slow as the actual 21064, which can actually write a partial cache
> line in only one bus cycle.

The merging has to occur somewhere. Given that ECC typically covers more than
32 bits - that was the 21064's basic unit - merging always costs, either in
the processor or in the memory system.

With the facts on the 21064 as presented in this thread, I would venture to
guess that it always used 32-bit ECCs (coming from DEC, I cannot imagine they
built a system without ECC). As that is the lowest size that supports a useful
ECC, doing byte-wise merging without substantial, and in essence equivalent to
write-allocate, costs in the memory subsystem seems impoassible (e.g., for the
21264A and later which support the 16- and 8-bit loads/stores).

	Jan


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-06-01 12:12               ` Carl Nelson
@ 2001-05-29 16:41                 ` Ben Franchuk
  2001-06-01 14:26                 ` Robert Deininger
  1 sibling, 0 replies; 25+ messages in thread
From: Ben Franchuk @ 2001-05-29 16:41 UTC (permalink / raw)


Carl Nelson wrote:

:
> This does assume that the base address of the array is aligned. If not, there
> is a preamble and a postamble that would have to do some cleanup, but you'd
> only have (at most) two out of 240 being fragments of full references. Also,
> realistically, there would be some loop unrolling to boot.

That was just a generic example. 
Quit with all the **** loop unrolling people.
No wait you have to unroll loops to make the CPU look good because
the **** pipelines are too **** deep.
BLOAT BLOAT BLOAT.
 
> It is also my understanding, from a general perusal of the alpha architecture
> handbook & compiler design guideline handbook that if you have a partial word
> to store that it is best to load the full word, mask off the portions you are
> modifying, OR in the modified bytes and write the full word back out again.
> IIRC there are alignment instructions particularly for this purpose, although
> I may be thinking of instructions for unaligned load & stitch.

No wait byte operations require both signed/unsigned forms. That extra bit
will make the instruction too complex! Did not the later models of 
ALPHA get byte operations.

RISC machines are fast only because you don't have "byte" sized operation
codes and the large register set gives the illusion of a harvard architecture.
I hate using any cpu that I can't get I get the operation time of 1 instruction.
Ben. 
-- 
"We do not inherit our time on this planet from our parents...
 We borrow it from our children."
"Luna family of Octal Computers" http://www.jetnet.ab.ca/users/bfranchuk
Updated - Now with schematics.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-29  8:45           ` Jan Vorbrueggen
@ 2001-05-29 17:36             ` David desJardins
  0 siblings, 0 replies; 25+ messages in thread
From: David desJardins @ 2001-05-29 17:36 UTC (permalink / raw)


Jan Vorbrueggen <jan@mailhost.neuroinformatik.ruhr-uni-bochum.de> writes:
> In fact, even the first version of the Alpha architecture specified
> longword (VAX speak for 4-byte entities) loads and stores - porting
> VMS would have been extremely difficult without this.

Right you are.  The minimum I/O unit is 4 bytes.

> With the facts on the 21064 as presented in this thread, I would
> venture to guess that it always used 32-bit ECCs

That's correct.  The 21064 has a 7-bit ECC for each 32-bit quadword.
See section 6.5.9.3 of the 21064 hardware reference manual:

http://gatekeeper.dec.com/pub/Digital/info/semiconductor/literature/21064hrm.pdf

                                        David desJardins


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-26 11:25     ` Jonathan Thornburg
  2001-05-26 20:29       ` Terje Mathisen
@ 2001-05-29 20:01       ` Eric C. Fromm
  1 sibling, 0 replies; 25+ messages in thread
From: Eric C. Fromm @ 2001-05-29 20:01 UTC (permalink / raw)


Jonathan Thornburg wrote:
> 
> In article <9ejpfu$l02$1@ausnews.austin.ibm.com>,
> McCalpin <mccalpin@austin.ibm.com> wrote:
> >Partial writes are ugly for many reasons:
> >
> >1. They may require lots of partial writes if (as is most
> >   reasonable) the merge function in the memory can only
> >   write contiguous fields.
> >   For example, a 128 Byte store buffer that has every
> >   other byte written either needs the memory controller
> >   merge function to support byte masks (yechh!) or it
> >   needs to make 64 partial writes (double yechh!).
> 
> Hmm.  A naive programmer's view would say
> * write 64 individual non-contiguous bytes
> * write-through cache --> writes go to main memory
> * expect 64 write transactions to memory
> which is just about what happens.

The off-chip secondary cache did not have to be write-though for
the 21064 (EV4) and likely wasn't in most implementations.  In
the 21164 (EV5), the 1st level cache is write-through but the
on-chip second level cache is write-back.

-eric




-- 
Eric C. Fromm                           efromm@sgi.com
Principal Engineer                      Scalable Systems Division
SGI - Silicon Graphics, Inc.            Chippewa Falls, Wi.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-05-28  5:03             ` Ben Franchuk
  2001-05-29  7:00               ` jmfbahciv
@ 2001-06-01 12:12               ` Carl Nelson
  2001-05-29 16:41                 ` Ben Franchuk
  2001-06-01 14:26                 ` Robert Deininger
  1 sibling, 2 replies; 25+ messages in thread
From: Carl Nelson @ 2001-06-01 12:12 UTC (permalink / raw)




Ben Franchuk wrote:

> John McCalpin wrote:
>
> > OK, so in a particularly contrived example you think that the write
> > allocate can cost a factor of four, or perhaps five if the bus loses
> > an additional cycle on the turnaround.  I do have to wonder what sort
> > of application only writes data and never reads anything from memory....
>
> You do how ever often fill a block of memory with a  constant.
>
> / clear video buffer
>   mov a,#SPACE
>   mov x,#video
>   mov c,#80*24
>   repeat c: mov.b x++,a
>
> --
> "We do not inherit our time on this planet from our parents...
>  We borrow it from our children."
> "Luna family of Octal Computers" http://www.jetnet.ab.ca/users/bfranchuk
> Updated - Now with schematics.

  Hmmm. Wouldn't a decent optimizing compiler turn that sequence into
something like:


  load register x with 2020202020202020h (Eight space characters)
  load register y with 1920 (80 * 24)
  load register z with base address of video

loop:
    store x at z            (full 64 bit store)
    increment z by 8
    decrement y by 8
  branch to loop if y not zero


This does assume that the base address of the array is aligned. If not, there
is a preamble and a postamble that would have to do some cleanup, but you'd
only have (at most) two out of 240 being fragments of full references. Also,
realistically, there would be some loop unrolling to boot.

It is also my understanding, from a general perusal of the alpha architecture
handbook & compiler design guideline handbook that if you have a partial word
to store that it is best to load the full word, mask off the portions you are
modifying, OR in the modified bytes and write the full word back out again.
IIRC there are alignment instructions particularly for this purpose, although
I may be thinking of instructions for unaligned load & stitch.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-06-01 12:12               ` Carl Nelson
  2001-05-29 16:41                 ` Ben Franchuk
@ 2001-06-01 14:26                 ` Robert Deininger
  2001-06-04 18:51                   ` Compaq
  1 sibling, 1 reply; 25+ messages in thread
From: Robert Deininger @ 2001-06-01 14:26 UTC (permalink / raw)


In article <3B1786C4.71BE2DA5@mcmail.maricopa.edu>, Carl Nelson
<carl.nelson@mcmail.maricopa.edu> wrote:

> Ben Franchuk wrote:
>  
> It is also my understanding, from a general perusal of the alpha architecture
> handbook & compiler design guideline handbook that if you have a partial word
> to store that it is best to load the full word, mask off the portions you are
> modifying, OR in the modified bytes and write the full word back out again.
> IIRC there are alignment instructions particularly for this purpose, although
> I may be thinking of instructions for unaligned load & stitch.

If it's still of any relevance to this discussion, I stumbled upon an old
document on my disk: "The Design of the DEC 3000 AXP System".  This
appears to be an archived fragment of "Digital Technical Journal Vol. 4
No. 4 Special Issue 1992".  I don't have the URL where I orginally found
it, and that URL would probably be broken now anyway.  But I think I saw
Digital Tech Journal archives somewhere at Compaq's web site recently, so
a little hunting should turn this document up.

The paper discusses the design of the DEC 3000-500 and DEC 3000-400
systems, which both used the 21064 CPU.  There's some detail about the
memory and cache systems, including some timing and bandwidth numbers.

Alas, the copy I found does not include any of the original figures, only text.

-- 
Robert Deininger
rdeininger@mindspring.com


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-06-01 14:26                 ` Robert Deininger
@ 2001-06-04 18:51                   ` Compaq
  2001-06-05 16:01                     ` Maciej W. Rozycki
  0 siblings, 1 reply; 25+ messages in thread
From: Compaq @ 2001-06-04 18:51 UTC (permalink / raw)


In article <rdeininger-0106011026190001@user-
2ivecbe.dialup.mindspring.com>, rdeininger@mindspring.com says...
> In article <3B1786C4.71BE2DA5@mcmail.maricopa.edu>, Carl Nelson
> <carl.nelson@mcmail.maricopa.edu> wrote:
> 
> > Ben Franchuk wrote:
> >  
> > It is also my understanding, from a general perusal of the alpha architecture
> > handbook & compiler design guideline handbook that if you have a partial word
> > to store that it is best to load the full word, mask off the portions you are
> > modifying, OR in the modified bytes and write the full word back out again.
> > IIRC there are alignment instructions particularly for this purpose, although
> > I may be thinking of instructions for unaligned load & stitch.
> 
> If it's still of any relevance to this discussion, I stumbled upon an old
> document on my disk: "The Design of the DEC 3000 AXP System".  This
> appears to be an archived fragment of "Digital Technical Journal Vol. 4
> No. 4 Special Issue 1992".  I don't have the URL where I orginally found
> it, and that URL would probably be broken now anyway.  But I think I saw
> Digital Tech Journal archives somewhere at Compaq's web site recently, so
> a little hunting should turn this document up.
> 
> The paper discusses the design of the DEC 3000-500 and DEC 3000-400
> systems, which both used the 21064 CPU.  There's some detail about the
> memory and cache systems, including some timing and bandwidth numbers.
> 
> Alas, the copy I found does not include any of the original figures, only text.
> 
> 
The Digital Technical Journal is archived at:
http://www.research.compaq.com/wrl/DECarchives/DTJ


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-06-04 18:51                   ` Compaq
@ 2001-06-05 16:01                     ` Maciej W. Rozycki
  2001-06-05 22:59                       ` Robert Deininger
  0 siblings, 1 reply; 25+ messages in thread
From: Maciej W. Rozycki @ 2001-06-05 16:01 UTC (permalink / raw)


On Mon, 4 Jun 2001, Compaq wrote:

> > The paper discusses the design of the DEC 3000-500 and DEC 3000-400
> > systems, which both used the 21064 CPU.  There's some detail about the
> > memory and cache systems, including some timing and bandwidth numbers.
> > 
> > Alas, the copy I found does not include any of the original figures, only text.
> > 
> The Digital Technical Journal is archived at:
> http://www.research.compaq.com/wrl/DECarchives/DTJ

 A number of issues (the Alpha one included) is available as text only.
They used to be available as PostScript and PDF at www.digital.com not so
long ago -- I've downloaded a few of them back in December.  Now they are
gone.

 I've put what I have at my FTP site recently -- see
'ftp://ftp.ds2.pg.gda.pl/pub/macro/DEC/'.  Fortunately, I happen to have
the document you are referring to -- check
'ftp://ftp.ds2.pg.gda.pl/pub/macro/DEC/DTJ804/DTJ804PF.PDF'.

 You may also try the mirror at
'ftp://ftp.rfc822.org/pub/mirror/ftp.ds2.pg.gda.pl/pub/macro/' if my site
is too slow for you. 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Historical Question on Alpha 21064
  2001-06-05 16:01                     ` Maciej W. Rozycki
@ 2001-06-05 22:59                       ` Robert Deininger
  0 siblings, 0 replies; 25+ messages in thread
From: Robert Deininger @ 2001-06-05 22:59 UTC (permalink / raw)


>  A number of issues (the Alpha one included) is available as text only.
> They used to be available as PostScript and PDF at www.digital.com not so
> long ago -- I've downloaded a few of them back in December.  Now they are
> gone.
> 
>  I've put what I have at my FTP site recently -- see
> 'ftp://ftp.ds2.pg.gda.pl/pub/macro/DEC/'.  Fortunately, I happen to have
> the document you are referring to -- check
> 'ftp://ftp.ds2.pg.gda.pl/pub/macro/DEC/DTJ804/DTJ804PF.PDF'.
> 
>  You may also try the mirror at
> 'ftp://ftp.rfc822.org/pub/mirror/ftp.ds2.pg.gda.pl/pub/macro/' if my site
> is too slow for you. 

On the mirror site, the DTJ804 directory is empty.  I'll keep trying the
slow site.  Thanks.

-- 
Robert Deininger
rdeininger@mindspring.com


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2001-06-05 22:59 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-24 16:10 Historical Question on Alpha 21064 McCalpin
2001-05-24 18:40 ` David desJardins
2001-05-24 18:45 ` Eric C. Fromm
2001-05-24 20:04   ` McCalpin
2001-05-24 20:36     ` David desJardins
2001-05-24 23:06       ` McCalpin
2001-05-24 23:54         ` David desJardins
2001-05-25 23:11           ` Jay R. Ashworth
2001-05-28 14:44           ` John McCalpin
2001-05-28  5:03             ` Ben Franchuk
2001-05-29  7:00               ` jmfbahciv
2001-06-01 12:12               ` Carl Nelson
2001-05-29 16:41                 ` Ben Franchuk
2001-06-01 14:26                 ` Robert Deininger
2001-06-04 18:51                   ` Compaq
2001-06-05 16:01                     ` Maciej W. Rozycki
2001-06-05 22:59                       ` Robert Deininger
2001-05-29  8:39             ` Jan Vorbrueggen
2001-05-29  8:45           ` Jan Vorbrueggen
2001-05-29 17:36             ` David desJardins
2001-05-25  8:57     ` Anton Ertl
2001-05-26 11:25     ` Jonathan Thornburg
2001-05-26 20:29       ` Terje Mathisen
2001-05-29 20:01       ` Eric C. Fromm
2001-05-24 21:02 ` Paul DeMone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox