Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Memory consistency problems on the 8400
@ 1997-03-25  5:00 Jonathan Hill
  1997-03-25  5:00 ` Dirk Grunwald
  1997-03-26  5:00 ` Stephen Hoff Hoffman
  0 siblings, 2 replies; 3+ messages in thread
From: Jonathan Hill @ 1997-03-25  5:00 UTC (permalink / raw)




Hello,

	I'm having some problems on an Alpha 8400 with memory
consistency between processors. I've developed some barrier
synchronisation routines that have a latency of 4 usec on the 8400
compared to 90usec for the best alternative technique that uses
semaphores (see [1] below). However, the barrier doesn't guarantee
memory consistency (so it's pretty useless ;-) as a process can have
writes that are still pending, although each of the processes have
reached a consistent state. There is a nice paper about this problem
from Digital WRL labs [2], which discusses write fences on the
alpha. Is there a system call for performing a memory fence on the
Alpha? i.e., something akin to the following operation which is
available on the T3E?

Thanks...
jon

[1] `Practical barrier synchronisation'' Jonathan M. D. Hill and David
B. Skillicorn. Technical Report 16-96, Programming Research Group,
Oxford University Computing Laboratory, August 1996. 
ftp://ftp.comlab.ox.ac.uk/pub/Documents/techpapers/Jonathan.Hill/HillSkill_barrier.ps.Z

[2] ``Shared memory consistency models: a tutorial'' S. Adve and K
Gharachorloo, Digital WRL labs, Sept 1995.



MEMORY_BARRIER(3I)             CrayLibs 2.0                     SR-3903 2.0

NAME
     MEMORY_BARRIER - Blocks subsequent memory load and store operations
     until all previous loads and stores finish

SYNOPSIS
     C:

     void _memory_barrier(void);

     Fortran:

     MEMORY_BARRIER ()

IMPLEMENTATION
     CRAY T3E systems

STANDARDS
     CF90 compiler extension to Fortran 90

     Cray Standard C compiler extension to Standard C

     Cray C++ compiler extension to Draft Standard C++

DESCRIPTION
     The MEMORY_BARRIER intrinsic subroutine guarantees that subsequent
     loads and stores do not access memory until after previous loads and
     stores finish accessing memory.

     MEMORY_BARRIER does not vectorize.  The compiler generates inline code
     to evalaute this intrinsic.  The name of this intrinsic cannot be
     passed as an argument.

SEE ALSO
     CF90 Fortran Language Reference Manual, Volume 2, publication SR-3903,
     for the printed version of this man page.

-- 
-----------------------------------------------------------
Jonathan Hill,      Oxford University Computing Laboratory
<http://www.comlab.ox.ac.uk/oucl/people/jonathan.hill.html>





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

* Re: Memory consistency problems on the 8400
  1997-03-25  5:00 Memory consistency problems on the 8400 Jonathan Hill
@ 1997-03-25  5:00 ` Dirk Grunwald
  1997-03-26  5:00 ` Stephen Hoff Hoffman
  1 sibling, 0 replies; 3+ messages in thread
From: Dirk Grunwald @ 1997-03-25  5:00 UTC (permalink / raw)



> from Digital WRL labs [2], which discusses write fences on the
> alpha. Is there a system call for performing a memory fence on the
> Alpha? i.e., something akin to the following operation which is
> available on the T3E?
--

Yeah, it's the memory barrier instruction.  Depending on your C
compiler, you can generate it in a number of ways. I believe that
the _mb() routine in /usr/lib/libc.a is simply a memory barrier
instruction wrapped in a procedure call.

Here's an example of a proper mutex on an Alpha, from the
pthread include file.

# define pthread_mutex_lock_prim(_m_) asm (" \
	ldah	%t2,0x10(%r31) ;\
    10: ldl_l	%v0,(%a0) ;\
	bne	%v0,30f ;\
	or	%v0,%t2,%t0 ;\
	stl_c	%t0,(%a0) ;\
	beq	%t0,20f ;\
	mb	; \
	br	%r31,30f ;\
    20: br	%r31,10b ;\
    30:", &(_m_)->_Pfield(lock))


-- 
Dirk Grunwald                 Assoc. Prof, Univ. of Colorado at Boulder



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

* Re: Memory consistency problems on the 8400
  1997-03-25  5:00 Memory consistency problems on the 8400 Jonathan Hill
  1997-03-25  5:00 ` Dirk Grunwald
@ 1997-03-26  5:00 ` Stephen Hoff Hoffman
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hoff Hoffman @ 1997-03-26  5:00 UTC (permalink / raw)




In article <w4k67yfygr4.fsf@pine.comlab>, Jonathan Hill <jonh@pine.comlab> writes:

:	I'm having some problems on an Alpha 8400 with memory
:consistency between processors. I've developed some barrier
:synchronisation routines...

  There are Alpha PALcode and hardware instructions designed and intended
  for this particular purpose, and -- depending on the operating system in
  use -- there are various other routines layered on these primitives.

  See the LDx_L and STx_C locked-load and locked-store instructions, and
  see the MB and WMB instructions, and see the IMB PALcode call.  (There
  are other PALcode calls that may be of interest, and particularly some
  of the interlocked PALcode calls present in the SRM PALcode...)

  One of the chapters of the Alpha Architecture Reference Manual (AARM)
  covers cache coherency, and mentions multiprocessor memory management
  machinations.

  If you're working at this level, you need a copy of the AARM...

  -------------------------- pure personal opinion ---------------------------
   Hoff (Stephen) Hoffman   OpenVMS Engineering   h*ffman@xdelta.enet.dec.c*m
     headers and addresses munged to avoid automated spammers: junk-e-mail




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

end of thread, other threads:[~1997-03-26  5:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-03-25  5:00 Memory consistency problems on the 8400 Jonathan Hill
1997-03-25  5:00 ` Dirk Grunwald
1997-03-26  5:00 ` Stephen Hoff Hoffman

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