07 Modul 7 - DSM
07 Modul 7 - DSM
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
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.
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
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.
V. Istilah-Istlah