Distributed Shared Memory
Distributed Shared Memory
Module 5
Distributed Shared Memory
Architecture of DSM
Architecture of DSM
Architecture of DSM
• The DSM abstraction presents a large shared-memory space to the processors of all
nodes.
• A software memory-mapping manager routine in each node maps the local memory
onto the shared virtual memory. To facilitate the mapping operation, the
shared-memory space is partitioned into blocks.
• Data caching is a well-known solution to address memory access latency. The idea of
data caching is used in DSM systems to reduce network latency. that is, the main
memory of individual nodes is used to cache pieces of the shared-memory
space. The memory- mapping manager of each node views its local memory as a big
cache of the shared - memory space for its associated processors. The basic unit of
caching is a memory block
Architecture of DSM
Architecture of DSM
Design & Implementation Issues
Design & Implementation Issues
Granularity
Granularity refers to the block size of a DSM system, that is, to the unit of sharing and the
unit of data transfer across the network when a network block fault occurs. Possible units
are a few words, a page, or a few pages. Selecting proper block size is an important part
of the design of a DSM system because block size is usually a measure of the granularity
of parallelism explored and the amount of network traffic generated by network block
faults.
Design & Implementation Issues
Structure of shared-memory space.
Structure refers to the layout of the shared data in memory. The structure of the shared-memory space of a
DSM system is normally dependent on the type of applications that the DSM system is intended to support.
Heterogeneity.
The DSM systems built for homogeneous systems need not address the heterogeneity issue. However, if the
underlying system environment is heterogeneous, the DSM system must be designed to take care of
heterogeneity so that it functions properly with machines having different architectures.
Design & Implementation Issues
Memory coherence and access synchronization.
In a DSM system that allows replication of shared data items, copies of shared data items may
simultaneously be available in the main memories of a number of nodes.
Thrashing.
In a DSM system, data blocks migrate between nodes on demand. Therefore, if two nodes compete for
write access to a single data item, the corresponding data block may be transferred back and forth at such
a high rate that no real work can get done. A DSM system must use a policy to avoid this situation (usually
known as thrashing).
Design & Implementation Issues
Data location and access.
To share data in a DSM system, it should be possible to locate and retrieve the data accessed by a user process.
Therefore, a DSM system must implement some form of data block locating mechanism in order to service network
data block faults to meet the requirement of the memory coherence semantics being used.
Replacement strategy.
If the local memory of a node is full, a cache miss at that node implies not only a fetch of the accessed data block from a
remote node but also a replacement. That is, a data block of the local memory must be replaced by the new data block.
Therefore, a cache replacement strategy is also necessary in the design of a DSM system.
Replication
Reasons for replication:
1. Reliability:
If a file system has been replicated it may be possible to continue working after one replica crashes by
simply switching to one of the other replicas. Also, it becomes possible to provide better protection
against corrupted data. e.g. There are 3 copies of a file & every read & write operation is performed on
each copy. We can safeguard ourselves against a single, failing write operation by considering the value
that is returned by at least two copies as being the correct one.
2. Performance:
When an increasing number of processes needs to access data that are managed by a single server. In that
case performance can be improved by replicating the server & subsequently dividing the work.
3. Response Time, throughput
4. Scalability
Consistency Models
A consistency model basically refers to the degree of consistency that should be maintained
for the shared memory data. There are two types of consistency models:
1. Data centric
2. Client centric consistency models
Consistency Models
1. Strict Consistency Model
• Any read on a data item x returns a value corresponding to the result of the most recent write on x
• This is the strongest form of consistency model.
2. Sequential Consistency Model
• In this model the result of any execution is the same as if the (read & write) operations by all processes
on the data store were executed is some sequential order & the operations of each individual process
appear in this sequence in the order specified by its program.
3. Linearizability Consistency Model
• The operations of each individual process appear in sequence order specified by its program.
• If tsOP1(x) < tsOP2(y), then operation OP1(x) should proceed OP2(y) in this sequence.
Linearizable = sequential + operation ordering according to global time
4. Causal Consistency Model
• In this model, all processes see only those memory reference operations in the correct order that are
potentially causally related.
• A memory reference operation is said to be causally related to another memory reference operation if
the first operation is influenced by the second operation.
5. FIFO Consistency Model
• It is weaker than causal consistency.
• This model ensures that all write operations performed by a single
process are seen by all other processes in the order in which they
were performed, like a single process in a pipeline.
e.g. FIFO consistency writes done by a single process are seen by all
other processes in the order in which they were issued, but writes
from different processes may be seen in a different order by different
processes.
6. Weak Consistency Model
• The basic idea behind the weak consistency model is enforcing
consistency on group of memory reference operations rather
than individual operations.
• It uses a special variable called a synchronization variable
which is used to synchronize memory.
• When a process accesses a synchronization variable, the
entire memory is synchronized by making visible the changes
made to the memory to all other processes.
6. Weak Consistency Model
7. Release Consistency Model