[CSE]  Advanced Operating Systems 
 COMP9242 2002/S2 
UNSW

PRINTER Printer-Friendly Version
Administration               
- Notices
- Course Intro
- Consultations
# On-line Survey (closed)
- Survey Results
 
Work
- Lectures
- Milestone 0
- Project Admin
- Project Spec
- Project FAQ
- Exam
 
Documentation
- ASysT Lab
- L4 source browser
- Sulima ISA Simulator
R4x00 ISA Summary 
MIPS R4700 ReferenceMIPS R4000 User Manual 
- Network Driver
- GT64111
 
Related Info
- Aurema OS Prize
- OS Hall of Fame
 
History
- 2000
- 1999
- 1998
 
Staff
- Gernot Heiser (LiC)

 
Valid HTML 4.0!
next up previous
Next: Partial store ordering Up: 10-smp Previous: Other Memory Models

Subsections

Total Store Ordering


  • Stores to write buffer hide memory latency.
  • Loads read from write buffer if possible.
  • Stores are guaranteed to occur in FIFO order.



CPU 0
store r1, adr1
load r2, adr2
CPU 1
store r1, adr2
load r2, adr1



  • Both CPUs may read old values!
cc-wb

Total store ordering breaks Decker:

void lock (volatile lock_t *l) {
   l->status[MYSELF] = LOCKED;
   while (l->status[OTHER] == LOCKED) {
      if (l->turn != MYSELF) {
         l->status[MYSELF] = !LOCKED;
         while (l->turn == OTHER) ;
         l->status[MYSELF] = LOCKED;
} } }

  • Need hardware support for synchronisation, e.g.:
    • atomic swap,
    • test&set,
    • load-linked & store-conditional (LL&SC),
    • memory barriers.
  • Stall pipeline and drain (& bypass) write buffer.


next up previous
Next: Partial store ordering Up: 10-smp Previous: Other Memory Models
Gernot Heiser 2002-10-11