Outline • Midterm results summary • Distributed file systems – continued • Distributed shared memory Midterm Results Summary • The distribution 70 0 75 4 80 6 85 1 90 3 1 100 1 95 > 100 2 • The average is 83.20 May 29, 2016 COP 5611 - Operating Systems 2 Distributed Shared Memory • Distributed computing is mainly based on the message passing model – Client/server model – Remote procedure calls • Distributed shared memory – is a resource management component that implements the shared memory model in distributed systems, where there is no physically shared memory May 29, 2016 COP 5611 - Operating Systems 3 Memory Hierarchies May 29, 2016 COP 5611 - Operating Systems 4 Virtual memory May 29, 2016 COP 5611 - Operating Systems 5 Page Table Mapping May 29, 2016 COP 5611 - Operating Systems 6 Distributed Shared Memory – cont. • This is a further extension of the virtual memory management on a single computer – When a process accesses data in the shared address space, a mapping manager maps the shared memory address to the physical memory, which can be local or remote May 29, 2016 COP 5611 - Operating Systems 7 Distributed Shared Memory – cont. May 29, 2016 COP 5611 - Operating Systems 8 Distributed Shared Memory – cont. A mapping manager is a layer of software to map addresses in user space into the physical memory addresses May 29, 2016 COP 5611 - Operating Systems 9 Distributed Shared Memory – cont. • With DSM, application programs can access data in the shared space as they access data in traditional virtual memory – Mapping manager can move data among the local main memory, local disk, and another nodes May 29, 2016 COP 5611 - Operating Systems 10 Distributed Shared Memory – cont. • Advantages of DSM – It is easier to design and develop algorithms with DSM than message passing models – DSM allows complex structures to be passed by reference, simplifying the distributed application development – DSM can cut down the overhead of communication by exploiting locality in programs – DSM can overcome some the architectural limitations of shared memory machines May 29, 2016 COP 5611 - Operating Systems 11 Distributed Shared Memory – cont. • Central implementation issues in DSM – How to keep track of the location of remote data – How to overcome the communication delays and high overhead associated with communication protocols – How to improve the system performance May 29, 2016 COP 5611 - Operating Systems 12 The Central-Server Algorithm • A central server maintains all the shared data – It serves the read requests from other nodes or clients by returning the data items to them – It updates the data on write requests by clients May 29, 2016 COP 5611 - Operating Systems 13 The Central-Server Algorithm – cont. May 29, 2016 COP 5611 - Operating Systems 14 The Migration Algorithm • In contrast to the central-server algorithm, data in the migration algorithm is shipped to the location of data access request – Subsequent accesses can then be performed locally • Thrashing can be a problem May 29, 2016 COP 5611 - Operating Systems 15 The Migration Algorithm – cont. May 29, 2016 COP 5611 - Operating Systems 16 The Read-Replication Algorithm • The read-replication algorithm allows multiple node to have read access or one node to have read-write access May 29, 2016 COP 5611 - Operating Systems 17 The Read-Replication Algorithm May 29, 2016 COP 5611 - Operating Systems – cont. 18 The Full-Replication Algorithm • This is a further extension of the readreplication algorithm – It allows multiple nodes to have both read and write access to shared data blocks • Data consistency issue May 29, 2016 COP 5611 - Operating Systems 19 The Full-Replication Algorithm May 29, 2016 COP 5611 - Operating Systems – cont. 20 Memory Coherence • Memory consistency models – – – – – Sequential consistency General consistency Processor consistency Weak consistency Release consistency May 29, 2016 COP 5611 - Operating Systems 21 Memory Coherence – cont. • Coherence protocols – A protocol to keep replicas coherent • Write-invalidate protocol – A write to a shared data causes the invalidation of all copies except the one where the write occurs • Write-update protocol – A write to a shared data causes all copies of that data to be updated May 29, 2016 COP 5611 - Operating Systems 22 Design Issues • Granularity – The size of the shared memory unit – Advantages of large sizes • A page size that is a multiple of the size provided by the underlying memory management system allows for the integration of DSM and the memory management system • Better utilization of locality of reference – Disadvantages • The greater the chance for contention • False sharing May 29, 2016 COP 5611 - Operating Systems 23 False Sharing May 29, 2016 COP 5611 - Operating Systems 24 Design Issues – cont. • Page replacement – Traditional methods such as LRU can not be used directly – Page access modes must be taken into consideration • For example, private pages may be replaced before shared pages May 29, 2016 COP 5611 - Operating Systems 25 Case Studies • IVY – Integrated Shared Virtual Memory at Yale – The granularity is a page – The address space is divided into shared virtual memory address space and private space • The coherence protocol – Write fault handling – Read fault handing May 29, 2016 COP 5611 - Operating Systems 26 IVY – cont. • Coherence protocol – The centralized manager scheme – Fixed distributed manager scheme – Dynamic distributed manager scheme May 29, 2016 COP 5611 - Operating Systems 27 IVY – cont. May 29, 2016 COP 5611 - Operating Systems 28 IVY – cont. • Double fault • Memory allocation • Process synchronization May 29, 2016 COP 5611 - Operating Systems 29 Case Studies – cont. • Mirage – Thrashing control • Clouds – The RA kernel – Distributed shared memory controller May 29, 2016 COP 5611 - Operating Systems 30 Summary • Distributed shared memory tries to provide an easy-to-use interface for distributed applications – Distributed programs access data in the shared address space as they access data in local memory • However, the performance is a critical issue – Replication is used to reduce the high cost of communications – Memory coherence needs to be taken of May 29, 2016 COP 5611 - Operating Systems 31