0% found this document useful (0 votes)
22 views

07 Modul 7 - DSM

The document discusses distributed shared memory (DSM), which allows processes in a distributed system to access shared data as if it were local physical memory. DSM provides a virtual shared address space across nodes and handles data movement and replication between nodes transparently. The key challenges of DSM include tracking data locations, minimizing overhead of remote data access, and allowing concurrent access to shared data consistently. The document outlines several DSM algorithms, including central server, migration, read replication, and full replication approaches.

Uploaded by

RAMADANI SAPUTRA
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

07 Modul 7 - DSM

The document discusses distributed shared memory (DSM), which allows processes in a distributed system to access shared data as if it were local physical memory. DSM provides a virtual shared address space across nodes and handles data movement and replication between nodes transparently. The key challenges of DSM include tracking data locations, minimizing overhead of remote data access, and allowing concurrent access to shared data consistently. The document outlines several DSM algorithms, including central server, migration, read replication, and full replication approaches.

Uploaded by

RAMADANI SAPUTRA
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Sistem Terdistribusi

Modul 7
Distributed Shared Memory
I. Introduction
Distributed Shared Memory (DSM) is a concept of abstraction which is used for
sharing of data in a distributed system where computers do not have physical
memory (RAM/ROM). DSM is one of the most valuable and attractive approach for
building large scale, high-performance multiprocessor system. DSM is a mechanism
which allows end users' processes to access data without using the inter-process
communications (IPC) or making the IPC transparent to end users. DSM is a tool for
parallel applications or for any distributed application or group of applications in
which shared data items can be accessed directly.
Points about DSM:
- DSM system provides a virtual address space which is shared among all devices
present in distributed system;
- With DSM, programs access data in shared address space the same as they
access data in traditional memory;
- In DSM, each devices can own the data which is stored in the shared address
space, ownership can be changed when data moves from one node to another;
- DSM software layer is implemented in the kernel of the device or as a runtime
library routine which maps shared memory address to the physical memory
address, when a process of a node accesses data in the shared address space.
- The DSM runtime support has to send updates in messages between
computers;
- DSM manages replicated data, each node has a local copy of the recently
accessed data stored in DSM for speed of access.

Advantages of DSM

 DSM are cheaper than tightly-coupled multiprocessor systems;


 DSM hides the explicit message passing and provides a simpler abstraction for
shared data that programmers are used to;
 Large physical memory can be formed by DSM;
 It takes advantages of the memory reference locality where data is moved in
the unit of pages;
 Programs for shared memory multiprocessors can be ported to DSM;
 Shared memory gives process to process communication which remains
transparent, and if desired, it can remove the user from any explicit awareness
of communication;
 Shared memory programs are usually short in length and easy to understand
than message passing programs. The memory accessing approach is already
popular with users.
Challenges of DSM

 To keep track of the location of data stored in remote location;


 To overcome the high overhead and communication delays associated with the
references to data stored in remote location;
 To allow concurrent accesses to shared data.

II. DSM Motivation and Architecture


Motivation / reason behind the development of DSM:

o Natural transition from sequential to distributed application;


o Data locality, on-demand data movement, and larger RAM reduce network
traffic due to remote paging;
o Better performance of some applications;
o Sender and receiver should not know each other;
o Flexible communication environment;
o Migration is completed only by transferring the corresponding PCB (process
control block) to the destination;
o No need to coexist the sender and receiver at the same time;
o Ease of process migration.

Architecture

A memory reference can be made by any processor to any memory location which is
physically separated memories that can be addressed as one logically shared address
space. These types of systems are called DSM. Address space is shared in shared
memory, 2 processors can refer to the same memory location. Memory references that
can be made by any processor to any memory location, is called Non-uniform Memory
Access (NUMA).
III. Design Issues in DSM

Granularity

Granularity is concerned with the data transfer processing. A larger memory page
increases the chance that multiple objects will reside in that one page, known as false
sharing. It happens when a process needs to access one memory location and some
other process needs to access other memory locations, but both memory locations are
mapped into the same memory page. When 2 computers want to access the same page,
then that page will have to be constantly transferred between that 2 computers, which
lead to thrashing.
To avoid thrashing, it is good to allow multiple copies of shared data to reside at
multiple computers simultaneously. Replication of data reduces the average cost of the
read operations since simultaneous read operations can be executed locally at multiple
nodes. However, writes become more expensive than reads since each cached copy of
data needs to be invalidated or updated.
In multiple-readers single-writer replication scheme means only one node to have a
read/write-copy of a page, or to allow multiple nodes to have a read-only copies of a
page.
- On a reads, the system will acquire a read only copy of a page if the page is not
local. By doing this, any node that has the memory page cached to local (with write
permissions enabled) will downgrade to read only permissions.
- On writes, if the page is not local or no write permissions exist, the DSM will
invalidate all copies of the page at other hosts and get an exclusive copy of the
page.
- DSM must keep track of the nodes that have a copy of the page / block of data.

In multiple-reader/multiple-writers replication scheme, read/write replication scheme


can be extended to full replication scheme, where multiple hosts will have read/write
access on shared data.

Page Replacement

A memory management scheme has to address the issue of page replacement because
the physical memory is limited. In DSM, which supports data movement, data can be
accessed in different modes which are: shared, private, read-only, writable, and etc.
To avoid degradation in the performance, a page replacement scheme would have to
take the following page access modes into consideration:
- Private pages can replace shared pages, as shared pages would have to be moved
over the network (possibly to their owner).
- Read only pages can be deleted simply as their owners retains a copy.

Once any page is selected for the replacement, DSM system must have to ensure that
the page will not lost forever. One alternative is to swap the page onto disk. A page can
be sent to the owner node if the page is a replica and is not owned by the node.
IV. Algorithm for Implementing DSM

There are four basic algorithms:


o Central Server Algorithm
o Migration Algorithm
o Read Replication Algorithm
o Full Replication Algorithm

Central Server Algorithm


All shared data is maintained by the central server. Other nodes of the distributed
system request for reading and writing data to the server which serves the request and
updates or provides access to the data along with acknowledgment messages.

These acknowledgment messages are used to provide the status of the data request is
served by the server. When the data is sent to the calling function, it acknowledges a
number that shows the access sequence of the data to maintain concurrency. And time-
out is returned in case of failure.

For larger distributed systems, there can be more than one server. In this case, the
servers are located using their address or using mapping functions.

Migration Algorithm
As the name suggest the migration algorithm does the work of migration of data
elements. Instead of using a central server serving each request, the block containing
the data requested by a system is migrated to it for further access and processing. It
migrates the data on request.

This algorithm though is good if when a system accesses the same block of data multiple
times and the ability to integrate virtual memory concept, has some shortcomings that
are needed to be addressed.
Only one node is able to access the shared data element at a time and the whole block is
migrated to that node. Also, this algorithm is more prone to thrashing due to the
migration of data items upon request by the node.

Read Replication Algorithm


In the read replication algorithm, the data block that is to be accessed is replicated and
only reading is allowed in all the copies. If a write operation is to be done, then all read
access is put on halt till all the copies are updated.

Overall system performance is improved as concurrent access is allowed. But write


operation is expensive due to the requirement of updating all blocks that are shared to
maintain concurrency. All copies of data element are to be tracked to maintain
consistency.

Full Replication Algorithm


An extension to read the replication algorithm allowing the nodes to perform both read
and write operation on the shared block of concurrently. But this access of nodes is
controlled to maintain its consistency.

To maintain consistency of data on concurrent access of all nodes sequence is


maintained and after every modification that is made in the data a multicast with
modifications is reflected all the data copies.
Characteristics:
o The multiple-readers/multiple-writers' protocol nodes have both write and read
access to shared data;
o One easy way to maintain the consistency is to use a gap-free sequencer;
o All nodes wishing to modify shared data will send the modification to the
sequencer. Sequencer will assign a particular sequence number and multicast the
modification with the sequence number to all nodes that have a copy of the shared
data item;
o Each node processes the modification requests in the sequence number order;
o At a node, there may be one or more modifications have been missed if a gap
between the modification requests' sequence number and the sequence number
expected.

V. Istilah-Istlah

 Distributed Shared Memory = suatu bentuk arsitektur memory dimana memory


yang terpisah secara fisik dapat digabung menjadi satu (secara logis).
 False Sharing = suatu teknik dimana sebuah page yang besar akan meningkatkan
peluang untuk lebih banyak obyek yang dapat menempati page tersebut.
 Network Traffic = lalu lintas data di jaringan.
 Thrashing = suatu proses dimana apabila 2 buah komputer ingin mengakses
page yang sama, maka page tersebut harus secara konstan dikirim ke 2
komputer tersebut secara bergantian.

You might also like