AOS UNIT-V Notes
AOS UNIT-V Notes
Distributed Scheduling: Issues in Load Distributing, Components of a Load Distributed Algorithm, Stability, Load Distributing Algorithms,
Requirements for Load Distributing, Task Migration, Issues in task Migration Distributed Shared Memory: Architecture and Motivation,
Algorithms for Implementing DSM, Memory Coherence, Coherence Protocols, Design Issues
Location policy: It determines the receiver node to accept a sent task from sender node. A
widely used method for finding a suitable node is through polling. In polling, a node polls
another node to find out whether it is a suitable node for load sharing. Nodes can be polled either
serially or in parallel (e.g., multicast). A node can be selected for polling either randomly, based
on the information collected during the previous polls or on a nearest-neighbor basis. An
alternative to polling is to broadcast a query to find out if any node is available for load sharing.
Information policy: It is responsible for deciding when information about the states of other
nodes in the system should be collected, where it should be collected from, and what information
should be collected. Most information policies are one of the following three types:
Demand-driven: In this class of policy, a node collects the state of other nodes only when it
becomes either a sender or a receiver (decided by the transfer and selection policies at the node),
making it a suitable candidate to initiate load sharing. Note that a demand-driven information
policy is inherently a dynamic policy, as its actions depend on the system state. Demand-driven
policies can be sender-initiated, receiver-initiated, or symmetrically initiated.
Periodic: In this class of policy, nodes exchange load information periodically. Based on the
information collected, the transfer policy at a node may decide to transfer jobs.
State-change-driven: In this policy, nodes broadcast information when their state changes by a
certain degree.
4. STABILITY
There are two views of stability of system in distributed scheduling. They are:
The queuing-theoretic perspective: When the arrival rate of jobs to a system is greater
than the rate at which it performs work, then CPU queue length grows and leads to unstable. By
transferring the new jobs to other system, we can maintain stability.
Selection policy: It prefers to transfer newly arrived process than partially executed processes.
Location policy: It selects a node at random and polls it to determine whether transferring a task
would place its queue length below the threshold level. If yes, then the polled node transfers a
task. Otherwise, other node is selected at random, and the procedure is repeated until either a
node that can transfer a task (a sender) is found or a static poll limit number of tries has failed to
find a sender.
Information policy: The information policy is demand driven, since polling starts only after a
node becomes a receiver.
Stability: Receiver-initiated algorithms do not cause system instability because, at high system
loads, a receiver is likely to find a suitable sender within a few polls. Consequently, polls are
increasingly effective with increasing system load, and little waste of CPU capacity results.
Drawback: If round-robin CPU scheduling algorithm used, a newly arrived task is quickly
provided a quantum of service. Consequently, most transfers are preemptive and therefore
expensive.
Location policy: The location policy has the following two components:
Sender-initiated component: In this component, the sender node broadcasts a REQUEST
message to find receiver node. If receiver node found, then sender chooses best task to
transfer.
Receiver-initiated component: In this component, the receiver node is one with load less
than the lower threshold value is chosen as receiver. Once receiver identified, it
broadcasts a ACCEPT message to find sender node. If sender node found, then sender
chooses best task to transfer to receiver node.
Selection policy: It prefers to transfer newly arrived process than partially executed processes. A
partially executed task is transferred only if its response time improves after moving.
Adaptive algorithms
Each node maintains three lists such as senders list, receivers list and OK list. Initially all the
nodes are added to receivers list and sender list is empty. OK list contain all the nodes whose
load is in between lower threshold (LT) and upper threshold (UT). A node moves from one list
to other list based on the load values. This algorithm adapts to the changes in load.
Transfer policy: The transfer policy is a threshold policy that uses two adaptive thresholds. The
transfer policy is triggered when new task originate or a task departs. A node whose load is less
than the lower threshold (LT) is considered a receiver, while a node whose load is greater than
the upper threshold (UT) is considered a sender. Nodes that have loads between these thresholds
lie within the acceptable range, so they are neither senders nor receivers.
Location policy: The location policy has the following two components:
Selection policy: The sender-initiated component considers only newly arrived tasks for transfer.
The receiver-initiated component can make use of any of the general selection policies.
Information policy: The information policy is demand-driven, as the polling activity starts
when a node becomes a sender or a receiver.
6. REQUIREMENTS FOR LOAD DISTRIBUTING
A distributed scheduler is a resource management component of a distributed operating system
that focuses on transparently redistributing the load of the system among the individual units to
enhance overall performance. Users submit tasks at their host computers for processing. The
need for load distribution arises in such environments because, due to the random arrival of tasks
and their random CPU service time requirements, there is a good possibility that several
computers are idle or lightly loaded and some others are heavily loaded, which would degrade
the performance. In real life applications there is always a possibility that one server or system is
idle while a task is being waited upon at another server.
Task Migration Issues: There are three issues in the task migration. They are:
i. State Transfer: There are two important issues to be considered. They are:
The cost to support remote execution may be high, which includes delays due to freezing
the task, obtaining and transferring the state and unfreezing the task. The lengthy freezing
of task during migration can cause abortion of tasks interacting with it due to timeouts.
Residual dependencies: Refer to the amount of resources a host of a migrated task
continues to dedicate to service requests from the migrated task. They are undesirable for
three reasons:-Reliability, performance and complexity.
ii. Location Transparency: Task Migration should hide the locations of tasks. Location
transparency in principle requires that name (process name, file name) be independent of
their locations (host names). Uniform name spacer throughout the system should be used.
iii. Structure of a migration mechanism: Generally there will be interaction between
the task migration mechanism, the memory management system, the inter-process
communication mechanism and the file system.
The mechanism should be designed to be independent for one another so that if one
mechanism’s protocol changes; the other’s need not the migration mechanism can be
turned off without interfering with other mechanisms.
iv. Performance: The performance of implementing task migration in different type of
systems varies due to different hardware, operating systems, IPC mechanisms, file
systems, etc.
Every node consists of one or additional CPU’s and a memory unit. High-speed communication
network is used for connecting these nodes. When a process accesses data in the shared address
space, a mapping manager maps the shared memory address space to the physical memory. To
reduce delays due to communication latency, DSM may move data at shared memory address
from a remote node to the node that is accessing data.
DSM hides data movement and provides a simpler abstraction for sharing data. This
makes Programmers don't need to worry about memory transfers and can design parallel
algorithms.
DSM allows the passing of complex structures by reference between nodes. This
simplifies development of algorithms for distributed applications.
DSM takes advantage of "locality of reference" by moving the entire page containing the
data referenced rather than just the piece of data. This reduce burden on communication
network.
Unlimited number of nodes can be used. Unlike multiprocessor systems where main
memory is accessed via a common bus, thus limiting the size of the multiprocessor
system.
Programs written for shared memory multiprocessors can be run on DSM systems.
Tracking of the memory address (location) of data stored remotely in shared memory.
To reduce the communication delays and high overhead associated with the references to
remote data.
Controlling the concurrent access of the data shared in DSM.
Based on these challenges there are algorithms designed to implement distributed shared
memory. There are four algorithms. They are:
(i). Central Server Algorithm:
All shared data is maintained by the central server. Other nodes of the distributed
system request the server for reading and writing data. The server serves these
requests with acknowledgment messages. These acknowledgment messages are used to
provide the status of the data request.
It is simpler to implement but the central server can become bottleneck. To overcome
this, shared data can be distributed among several servers. This distribution can be
addressed by using a mapping function to locate the appropriate server.
(ii). Migration Algorithm:
Instead of using a central server to serve each request, in migration algorithm the
requested data is migrated (shipped) to request node which allows subsequent access to
the same data can be performed locally. This algorithm is good if when a system accesses
the same block of data multiple times.
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.
On the other hand, in multiprocessor systems, two or more processing elements work
concurrently. Once in a while they will simultaneously access the same memory location. As
long as no processing element alters the data at the affected location, all of those elements can
share and cache the data without any problems. But if one of the processing elements changes
the data in the shared location and does not inform the others of the change, the other elements
might use the outdated version of the data that remains in their local caches.
Consequently, some scheme is required to notify all the processing elements of changes
to shared values; such a scheme is known as a memory coherence protocol, and if such a
protocol is employed the system is said to have a coherent memory.
11. COHERENCE PROTOCOLS
To provide concurrent access, DSM systems make use of data replication (duplications), where
copies of data are maintained at all the nodes accessing the data. A fundamental problem with
data replication is the difficulty in ensuring that all copies have the same information and that
nodes do not access outdated data. In other words, a protocol to keep replicas coherent is needed.
Two basic protocols to maintain coherence are the write-invalidate protocol and the write-update
protocol.
WRITE-INVALIDATE PROTOCOL:
Let us consider three processors P1, P2, and P3 having a consistent copy of data element ‘X’ in
their local cache memory and in the shared memory. That is all the caches and shared memory
have the same value. This is shown in the above diagram. When processor P1 modifies the X
value to X1, then it writes X1 in its cache memory using write-invalidate protocol. This
protocol makes all other copies are invalidated via the bus. It is denoted by ‘I’. This is shown in
the below diagram. Invalidated blocks are also known as dirty, i.e. they should not be used. This
protocol is inefficient if many nodes frequently access the data which is modified more
frequently because an updated object not copied back to many nodes immediately after every
invalidation.
WRITE-UPDATE PROTOCOL
In the write-update method, a write to a shared data causes all copies of that data to be updated.
This is shown in the below diagram. This approach is more difficult to implement than the
previous approach, as a new value has to be sent instead of sending invalidation messages. This
protocol can be expected to generate considerable network traffic. But, it is better approach, if
the frequency of modified data is high.
12. DESIGN ISSUES
The two issues to be considered in the design of a DSM system are granularity and page
replacement.
They are important because the efficiency Of DSM depends on the effectiveness Of the size
chosen for granularity and the protocol used for page replacement.
Granularity: Granularity refers to the size of the shared memory unit. When the page size
matches with the underlying hardware or the memory management system page size, it allows
for the integration Of DSM and the memory management systems. By integrating DSM with the
underlying memory management system, a DSM system can take advantage of the built-in
protection mechanism to detect incoherent memory references, and use built-in fault handlers to
prevent and recover from inappropriate references.
The design issue is to chose either large page size or small page size. A large page size for the
shared memory unit will take advantage of the locality of reference exhibited by processes. By
transferring large pages, less overhead is incurred due to paging activity and processing
communication protocols. However, the larger the page size, the greater the chance for
contention to access a page by many processes. Smaller page sizes are less apt to cause
contention as they reduce the likelihood of false sharing. False sharing of a page occurs when
two different data items, not shared but accessed by two different processes, are allocated to a
single page.
Page Replacement: A memory management system has to address the issue of page
replacement because the size of physical memory is limited. In DSM systems that support data
movement, traditional methods such as least recently used (LRU) page replacement algorithm
cannot be used directly. Other approaches are required to implement LRU.
- O0Oo -