![Page 1: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/1.jpg)
Tornado: Maximizing Locality and Concurrency in a SMMP OS
![Page 2: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/2.jpg)
Contents
Types of Locality Locality: A closer look Requirements for locality Design Basics of Tornado Test Results Conclusion
![Page 3: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/3.jpg)
Types of Locality* Temporal locality
“The concept that a resource that is referenced at one point in time will be referenced again sometime in the near future.”
Spatial locality“The concept that the likelihood of referencing a
resource is higher if a resource near it has been referenced.”
Sequential locality“The concept that memory is accessed
sequentially.”
*Source: Wikipedia
![Page 4: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/4.jpg)
Locality: A closer look, Read only case
bool x = true;while (x) { // Do some work // reading but not // writing x…}
Processor # 1
x
Processor # 2
xCache Cache
xMemory
![Page 5: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/5.jpg)
Locality: A closer look, Read only case
bool x = true;while (x) { // Do some work // reading but not // writing x…}
Processor # 1
x
Processor # 2
x
x
Cache Cache
Memory
![Page 6: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/6.jpg)
Locality: A closer look, Read only case
bool x = true;while (x) { // Do some work // reading but not // writing x…}
Processor # 1
x
Processor # 2
x
x
Cache Cache
Memory
![Page 7: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/7.jpg)
Locality: A closer look, Read only case
bool x = true;while (x) { // Do some work // reading but not // writing x…}
Processor # 1
x
Processor # 2
x
x
Cache Cache
Memory
Notes: No accesses on the bus Because accesses are
reads that are satisfied in local caches and no invalidations are sent
![Page 8: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/8.jpg)
Locality: A closer look, Read/Write case
bool x = true;while (x) { x = false; // Do other // work…}
Processor # 1
x
Processor # 2
x Cache
xMemory
bool x = true;while (x) { x = false; // Do other // work…}
![Page 9: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/9.jpg)
Locality: A closer look, Read/Write case
bool x = true;while (x) { x = false; // Do other // work…}
Processor # 1
x
Processor # 2
x
xMemory
bool x = true;while (x) { x = false; // Do other // work…}
![Page 10: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/10.jpg)
Locality: A closer look, Read/Write case
bool x = true;while (x) { x = false; // Do other // work…}
Processor # 1
x
Processor # 2
x
xMemory
bool x = true;while (x) { x = false; // Do other // work…}
Invalidate block containing x
![Page 11: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/11.jpg)
Locality: A closer look, Read/Write case
bool x = true;while (x) { x = false; // Do other // work…}
Processor # 1
x
Processor # 2
x
xMemory
bool x = true;while (x) { x = false; // Do other // work…}
2. Read request
1. Cache miss
![Page 12: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/12.jpg)
Locality: A closer look, Read/Write case
bool x = true;while (x) { x = false; // Do other // work…}
Processor # 1
x
Processor # 2
x
xMemory
bool x = true;while (x) { x = false; // Do other // work…}
2. Read request
1. Cache miss
3. Data
![Page 13: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/13.jpg)
Locality: A closer look, Read/Write case
bool x = true;while (x) { x = false; // Do other // work…}
Processor # 1
x
Processor # 2
x
xMemory
bool x = true;while (x) { x = false; // Do other // work…}
2. Read request
1. Cache miss
3. Data
4. Write
5. Invalidate block containing x Notes:
x becomes a bottleneck, the valid copy keeps jumping from one cache to the other
Every write access causing invalidation
Almost every read causing a read miss and a bus read
![Page 14: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/14.jpg)
Locality: A closer look, Effect of Cache Line Length
bool x = true;while (x) { x = false; // Do other // work…}
Processor # 1
x,y
Processor # 2
x
Memory
bool y = true;while (y) { y = false; // Do other // work…}
y0x00x4
x,y
Notes: x & y have different
addresses but fall into the same cache line (block)!
![Page 15: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/15.jpg)
Locality: A closer look, Effect of Cache Line Length
bool x = true;while (x) { x = false; // Do other // work…}
Processor # 1
x,y
Processor # 2
x
Memory
bool y = true;while (y) { y = false; // Do other // work…}
y0x00x4
x,y
Notes: Read doesn’t cause
any problem
![Page 16: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/16.jpg)
Locality: A closer look, Effect of Cache Line Length
bool x = true;while (x) { x = false; // Do other // work…}
Processor # 1
x,y
Processor # 2
x
Memory
bool y = true;while (y) { y = false; // Do other // work…}
y0x00x4
x,y
Notes: Remember: Invalidations are
per cache-line/block not word! So we have pretty much the
same behavior as the read/write case on a single variable
Invalidate block containing x & y
![Page 17: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/17.jpg)
Requirements for Locality
Spatial and temporal locality Minimizing read/write and write
sharing Minimize false sharing Minimize the distance between the
accessing processor and the target memory module.
![Page 18: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/18.jpg)
Design Basics for Tornado
Individual resources are individual objects
Clustering objects Protected procedure calls (PPC) Semi-automatic garbage collection
![Page 19: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/19.jpg)
Clustered Objects Appears as a
single object from the outside but is internally split into reps
Each rep handles requests from one or more processors
Lots of advantages to this design
![Page 20: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/20.jpg)
Clustered Objects (cont.) Per-processor
translation tables Partitioned global
translation table Default “miss”
handlers
![Page 21: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/21.jpg)
Protected Procedure Calls Microkernel: relies
on servers to carry on part of the OS job
As many server threads as there are clients
A request is handled on the same processor where it was issued
*Image source: Wikipedia
![Page 22: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/22.jpg)
Garbage Collection
Semi-automatic Makes distinction between
temporary and persistent references to objects
Eliminates the need for two locks to guarantee existence and locking altogether for read only data
![Page 23: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/23.jpg)
Test Results: Effect of rep Count (1)
![Page 24: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/24.jpg)
Test Results: Effect of rep Count (2)
![Page 25: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/25.jpg)
Test Results: Effect of Cache Associativity
![Page 26: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/26.jpg)
Test Results: Tornado vs. Commercial OSes
![Page 27: Tornado: Maximizing Locality and Concurrency in a SMMP OS](https://reader035.vdocument.in/reader035/viewer/2022062500/5681503d550346895dbe3b3e/html5/thumbnails/27.jpg)
Conclusion
Tornado performs much better than many commercial OSes
The concept of clustered objects gives it a lot of advantage High locality of data Diminished need for locking Higher degree of sharing,
concurrency and modularity