Region-Based Software Distributed Shared Memory
description
Transcript of Region-Based Software Distributed Shared Memory
![Page 1: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/1.jpg)
Region-Based Software Distributed Shared Memory
Song Li, Yu Lin, and Michael Walker
CS 656 -- Operating Systems
May 1, 2000
![Page 2: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/2.jpg)
Outline
• Motivation
• Problems
• DSM Models
• Proposed Solution
• Conclusion
![Page 3: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/3.jpg)
Motivation
• Share distributed resources to increase computing power– First Solution: Tightly-coupled system– Problem: Central memory bus– Alternative: Loosely-coupled system– New Problem: Need IPC in distributed systems
![Page 4: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/4.jpg)
Motivation: RPC
• Solution: Remote Procedure Calls (RPC)– Snd/Rcv protocol– Pass-by-value– OS Assignment 1
• Problems with RPC– Explicit awareness of communication– Marshalling complex data structures is hard
![Page 5: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/5.jpg)
Motivation: DSM
• Solution: Distributed Shared Memory (DSM) [Li86--Yale]– Idea: Nonresident pages are fetched from network
– Illusion of tightly-coupled system in a loosely-coupled one
– Abstraction on top of message-passing model– Programmers use memory-accessing paradigm
![Page 6: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/6.jpg)
DSM: Potential Benefits
• Shared access to memory
• Avoids Von-Neumann bottleneck
• Familiar abstraction
• Pass-by-reference
• Spreads communication load over time
• Provides more memory than is locally available
![Page 7: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/7.jpg)
Problems
• Who handles remote access?
• What should be shared?
• Cache, cache, cache…but how?
• Page Replacement & Thrashing
• More than one way to solve the problems...
![Page 8: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/8.jpg)
DSM Models: Decisions
• Hardware: MMU controls message passing, data migration, and caching
• Software: Control managed by OS or library
• Page-based shared memory versus shared variable versus Object
• Cache consistency models
![Page 9: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/9.jpg)
Proposed Solution: Overview
• Software-based model using libraries
• Variable-size regions -- similar to segments– Every granularity has its advantages/drawbacks– Make the region size flexible, provide
reasonable defaults (sound familiar?)
• Multiple reader, single writer (MRSW) caching support
![Page 10: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/10.jpg)
Solution: User Interface
• r_handle sm_malloc(size);• int sm_regionat(r_handle, attrib);• int sm_read(r_handle, offset, buf, size);
• int sm_write(r_handle, offset, buf, size);
• int sm_regiondt(r_handle);• int sm_free(r_handle);
![Page 11: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/11.jpg)
Solution: Mode of Operation
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
![Page 12: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/12.jpg)
Solution: Mode of Operation
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
(1) Allocate memory
![Page 13: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/13.jpg)
Solution: Mode of Operation
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
(2) Query table & attach region
![Page 14: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/14.jpg)
Solution: Mode of Operation
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
(3) Send region info to client
![Page 15: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/15.jpg)
Solution: Mode of Operation
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
(4) Client communicates with provider
![Page 16: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/16.jpg)
Solution: Mode of Operation
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
(5) Client uses cached copy
![Page 17: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/17.jpg)
Solution: Mode of Operation
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
(6) Client detaches and frees memory
![Page 18: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/18.jpg)
Solution: Mode of Operation
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
(7) Memory is freed
![Page 19: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/19.jpg)
Solution: MRSW Caching Model
• Replication is good for reads, so allow MR– No communication overhead
• Writer requires cache invalidation, so restrict to SW– MW is too complicated
![Page 20: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/20.jpg)
Solution: MRSW Caching Model
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
Readers
(1) Multiple readers
![Page 21: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/21.jpg)
Solution: MRSW Caching Model
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
Readers Writer
?
(2) Write request
![Page 22: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/22.jpg)
Solution: MRSW Caching Model
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
Readers Writer
(3) Cache invalidation to selected clients only
![Page 23: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/23.jpg)
Solution: MRSW Caching Model
...
...Provider 1
Shared Memory
ManagerMaster Table
Client 1
Cache
Client Table
Client 2
Cache
Client Table
Client n
Cache
Client Table
Provider 2
Shared Memory
Provider n
Shared Memory
Readers Writer
(4) Single writer, multiple readers
![Page 24: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/24.jpg)
Conclusion: Current Status
• Basic client/manager model is implemented
![Page 25: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/25.jpg)
Conclusion: Remaining Work
• Page replacement strategy: LRU
• Region protection mechanism
• Replicated managers for better performance and fault tolerance
• Evaluation...
![Page 26: Region-Based Software Distributed Shared Memory](https://reader035.fdocuments.us/reader035/viewer/2022062217/568149df550346895db7078b/html5/thumbnails/26.jpg)
Conclusion: Evaluation
• Find distributed apps to use DSM model
• Performance evaluation:– Test apps with DSM model and message-
passing model– Desired results: DSM performance is better