2. Process Migration
ο Relocationof a process from its current location to
another node.
ο Process may be migrated
ν either before it start executing on its source node
ο known as non-preemptive process migration.
ν or during the course of its execution
ο Known as preemptive process migration.
3. Process Migration
• Selecting a process to be
migrated
• Selecting the destination node
• Suspending the process
• Capturing the process state
• Sending the state to the
destination
• Resuming the process
• Forwarding future messages to
the destination
Process P1
:
:
:
:
Execution
suspended
Source Site Destination Site
Execution
Resumed
:
:
:
:
Process P1
Transfer of
control
Time
Freezing
time
4. Desirable features of a good process
migration mechanism
ο
ο
ο
ο
ο
ο
Transparency
Minimal Interference
Minimal Residual Dependencies-
Efficiency
Robustness
Communication between coprocesses of a job
6. Minimal Interference
ο Migration of a process should cause minimal
interference of progress of the process involved.
ο Achieve by minimizing the freezing time of the
process being migrated.
ν Freezing time is the time period for which the execution
of the process is stopped for transferring its information to
the destination node.
8. Efficiency
ο Minimum time required for migrating a
process.
ο Minimum cost of locating an object.
ο Minimum cost of supporting remote execution
once the process is migrated.
9. Robustness
ο Except the failure of a node on which a process is
currently running should not affect the
accessibility or execution of process.
10. Communication between coprocessors of a
job
ο To reduce communication cost, it is necessary that
coprocesses are able to directly communicate with
each other irrespective of their locations.
11. Process Migration
Benefits
• Better response time and execution speed-up
–Dynamic load balancing among multiple nodes
• Higher throughput and Effective resource utilization
–Migrating I/O and CPU-bound processes to file and cycle servers.
• Reducing network traffic
–Migrating processes closer to the resources they are using most
heavily.
• Improving system reliability
–Migrating processes from a site in failure to more reliable sites
–Replicating and migrating critical processes to a remote.
12. Process Migration Mechanisms
Four major activities
1. Freezing the process on its source node and restarting it
on its destination node.
2. Transferring the process’s address space from its
source node to its destination node.
3. Forwarding messages meant for the migrant process.
4. Handling communication between cooperating
processes that have been separated as a result of process
migration.
13. Cont… : Mechanisms for Freezing and
Restarting a Process
ο Freezing the process:
ν The execution of the process is suspended in the source
node and the state of information is transferred to its
destination node and from there it is restarted.
ο Issues:
ν
ν
ν
ν
Immediate and delayed blocking of the process
Fast and slow I/O operations
Information about open files
Reinstating the process on its Destination node
14. Cont… : Reinstating the process on its
Destination Node
ο On the destination node, an empty process state is
created.
15. Cont…
ο Once all the state of the migrating process has been
transferred from the source to destination node and
copied into the empty state, new copy of the process
is unfrozen and old copy is deleted.
ο The process is restarted on its destination node in
whatever state it was in before being migrated.
16. Address Space Transfer Mechanisms
ο The migration of a process involves the
transfer of
ν
ν
Process’s state
Process’s address space
from the source node to the destination
node.
17. Address Space Transfer Mechanisms
• Since the target process for migration is preempted , its
state information must also be transferred.
• State information consists of computation state and
communication state .
• The computation state is the information necessary to
save and restore a process at the remote site and
• communication state is the status of process
communication links and messages in transit.
18. Process State consists of
• CPU registers
–Captured upon a freeze
• Address space
–Difficult to restore pointers
• I/O state:
–Fast I/O Operations
•Completed before a process migration
–Durable I/O Operations like files and user interactions
•Difficult to carry files in use and to freeze/restore system calls.
•Necessity to maintain a connection with I/O established at the source
node.
20. Cont…
ο Mechanisms for address space transfer:
ν
ν
ν
Total freezing
Pre-transferring
Transfer on reference
21. Process Migration
Address Transfer Mechanisms
Transfer of
address space
Source
node
Destination
node
Suspended
Migration
decision
resumed
Freezing
time
Transfer of
address space
Source
node
Destination
node
Suspended
Migration
decision
resumed
Freezing
time
On-demand
transfer
Source
node
Destination
node
Suspended
Migration
decision
resumed
Freezing
time
Total Freezing Pretransferring Transfer-on-reference
Merits: easy
implementation
Demerits:long delay time
Merits: freezing time
reduce
Demerits:total time
Merits: quick migration
Demerits: large memory
latency
22. Cont… : Total Freezing
ο A process’s execution is stopped while its address
space is being transferred.
ο Disadvantage:
ν Process is suspended for long time during migration,
timeouts may occur, and if process is interactive, the
delay will be noticed by the user.
23. Cont … : Pretransferring
ο Also known as precopying.
ο The address space is transferred while the process is
still running on the source node.
ο After the transfer, the modified pages are picked
up.
24. Cont …
ο Reduces the freezing time of the process but it
may increase the total time for migrating due to
the possibility of redundant page transfers.
25. Cont… : Transfer on Reference
ο The process address space is left behind on its
source node, and as the relocated process executes
on its destination node.
ο Attempts to reference memory page results in the
generation of requests to copy in the desired
blocks from their remote location.
ο A page is transferred from its source node to its
destination node only when referenced.
26. Cont…
ο Very short switching time of the process from its
source node to its destination node.
28. Process Migration
Message Forwarding Mechanisms
Sender
Origin
Dest 1
Dest 2
Receiver
Migrate
Migrate again
Resend
Resend again
Sender
Origin
Dest 1
Dest 2
Receiver
Migrate
Migrate again
Resending messages Ask origin site
SendSend
Forward
29. Process Migration
Message Forwarding Mechanisms (Cont’d)
Sender
Origin
Dest 1
Dest 2
Receiver
Migrate
Migrate again
Link Update
Send
Sender
Origin
Dest 1
Dest 2
Receiver
Migrate
Migrate again
Link traversal
Link
Link
Send
Forward
Forward
Send
New location
Send
New location
Send
Current location
30. Cont… : Mechanisms of resending the
message
ο Messages of are returned to the sender as not
deliverable or are simply dropped, with the
assurance that the sender of the message is storing
a copy of the data and is prepared to retransmit it.
31. Cont…
ο Disadvantage:
ν The message forwarding mechanism of process
migration operation is nontransparent to the
processes interacting with the migrant process.
32. Cont… : Origin Site Mechanism
ο Each site is responsible for keeping information
about the current locations of all the processes
created on it.
ο Messages for a particular process are always first
sent to its origin site.
ο The origin site then forwards the message to the
process’s current location.
34. Cont… : Link Traversal Mechanism
ο To redirect message, a message queue for the
migrant process is created on its source node.
ο A forwarding address known as link is left at the
source node pointing to the destination of the
migrant process.
ο Components of link, one is unique process
identifier and second is last known location.
35. Cont…
ο Disadvantage:
ν Several link may have to be traversed to locate a process
from a node and if any node in chain of link fails, the
process cannot be located.
36. Cont… : Link Update Mechanisms
ο Link update message
ν
ν
Tells the new address of each link held by the migrant
process.
Acknowledged for synchronization purposes.
37. Mechanisms for Handling
Coprocesses
ο To provide efficient communication between a
process and its sub processes which might have
been migrated on different nodes.
ο Mechanisms :
ν
ν
Disallowing separation of coprocesses.
Home node or origin site concept.
38. Cont… : Disallowing Separation of
coprocesses
ο Easiest method of handling communication
between coprocesses is to disallow their separation.
ο Methods :
ν
ν
By disallowing the migration of processes that wait for
one or more of their children to complete.
By ensuring that when a parent process migrates,its
children process will be migrated along with it.
40. Cont… : Home node or Origin Sites
Concept
ο Used for communication between a process and its
sub process when the two are running on different
nodes.
ο Allows the complete freedom of migrating a
process or its sub process independently and
executing them on different nodes of the system.
41. Cont…
ο Disadvantage:
ν All communication between a parent process and its
children processes take place via the home node.
ο traffic and the communication cost increaseThe message
considerably.
42. Advantages of Process Migration
ο Reducing average response time of processes
ν To reduce the average response time of the processes,
processes of a heavily loaded node are migrated to idle or
underutilized nodes.
ο Speeding up individual jobs
ν
ν
ν
A migration of job to different node is done and execute
them concurrently.
Migrate a job to a node having a faster CPU or to a node
at which it has minimum turnaround time.
More speed up more migration cost involved.
43. Cont…
ο Gaining higher throughput
ν Process migration facility may also be used properly to
mix I/O and CPU-bound processes on a global basis for
increasing the throughput of the system.
ο Utilizing resources effectively
ν Depending upon the nature of a process, it can be
migrated to suitable node to utilize the system resource in
the most efficient manner.
44. 59
Cont…
ο Reducing network traffic
ν Migrating a process closer to the resources it is using
most heavily.
ο Improving system reliability
ν Migrate a copy of a critical process to some other node
and to execute both the original and copied processes
concurrently on different nodes.
ο Improving system security
ν A sensitive process may be migrated and run on a secure
node.