Process Migration
oRelocationof a process from its current location to
another node.
oProcess may be migrated
neither before it start executing on its source node
oknown as non-preemptive process migration.
nor during the course of its execution
oKnown as preemptive process migration.
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
Desirable features of a good process
migration mechanism
o
o
o
o
o
o
Transparency
Minimal Interference
Minimal Residual Dependencies-
Efficiency
Robustness
Communication between coprocesses of a job
Transparency
Level of transparency:(Location
Independent)n
n
Object Access Level
System Call & Interprocess Communication level
Minimal Interference
oMigrationofaprocessshouldcauseminimal
interference of progress of the process involved.
oAchievebyminimizingthefreezingtimeofthe
process being migrated.
nFreezing time is the time period for which the execution
of the process is stopped for transferring its information to
the destination node.
Minimal Residual
Dependencies
oThe process migrated should not depend
on any factor with the previous process.
Efficiency
oMinimum time required for migrating a
process.
oMinimum cost of locating an object.
oMinimumcostofsupportingremoteexecution
once the process is migrated.
Robustness
oExcept the failure of a node on which a process is
currently running should not affect the
accessibility or execution of process.
Communication between coprocessors of a
job
oTo reduce communication cost, it is necessary that
coprocesses are able to directly communicate with
each other irrespective of their locations.
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.
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.
Cont… : Mechanisms for Freezing and
Restarting a Process
oFreezing the process:
n
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.
oIssues:
n
n
n
n
Immediate and delayed blocking of the process
Fast and slow I/O operations
Information about open files
Reinstating the process on its Destination node
Cont… : Reinstating the process on its
Destination Node
oOnthedestinationnode,anemptyprocessstateis
created.
Cont…
oOnce 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.
oTheprocessisrestartedonitsdestinationnodein
whatever state it was in before being migrated.
Address Space Transfer Mechanisms
oThemigrationofaprocessinvolvesthe
transfer of
n
n
Process’s state
Process’s address space
from the source node to the destination
node.
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.
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.
Cont…
oProcess address space
n
n
n
code,
data and
program stack
Cont…
oMechanisms for address space transfer:
n
n
n
Total freezing
Pre-transferring
Transfer on reference
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
extended
Merits: quick migration
Demerits: large memory
latency
Cont… : Total Freezing
oA process’sexecutionis stoppedwhile its address
space is being transferred.
oDisadvantage:
nProcess is suspended for long time during migration,
timeouts may occur, and if process is interactive, the
delay will be noticed by the user.
Cont … : Pretransferring
oAlso known as precopying.
oThe address space is transferred while the process is
still running on the source node.
oAfter the transfer, the modified pages are picked
up.
Cont …
oReduces the freezing time of the process but it
may increase the total time for migrating due to
the possibility of redundant page transfers.
Cont… : Transfer on Reference
oThe process address space is left behind on its
source node, and as the relocated process executes
on its destination node.
oAttempts to reference memory page results in the
generation of requests to copy in the desired
blocks from their remote location.
oApageistransferredfromitssourcenodetoits
destination node only when referenced.
Cont…
oVeryshortswitchingtimeoftheprocessfromits
source node to its destination node.
Cont…
oMechanisms:
n
n
n
n
Mechanism of resending the message
Origin site mechanism
Link traversal mechanism Link
update mechanism
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
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
Cont… : Mechanisms of resending the
message
oMessages 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.
Cont…
oDisadvantage:
nThe message forwarding mechanism of process
migration operation is nontransparent to the
processes interacting with the migrant process.
Cont… : Origin Site Mechanism
oEach site is responsible for keeping information
about the current locations of all the processes
created on it.
oMessagesforaparticularprocessarealwaysfirst
sent to its origin site.
oTheoriginsitethenforwardsthemessagetothe
process’s current location.
Cont…
oDisadvantage:
n sitewilldisruptthemessageFailureoftheorigin
forwarding
mechanism.
Cont… : Link Traversal Mechanism
oTo redirect message, a message queue for the
migrant process is created on its source node.
oA forwarding address known as link is left at the
source node pointing to the destination of the
migrant process.
oComponents of link,oneisuniqueprocess
identifier and second is last known location.
Cont…
oDisadvantage:
nSeveral 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.
Cont… : Link Update Mechanisms
oLink update message
n
n
Tells the new address of each link held by the migrant
process.
Acknowledged for synchronization purposes.
Mechanisms for Handling
Coprocesses
oTo provide efficient communication between a
process and its sub processes which might have
been migrated on different nodes.
oMechanisms :
n
n
Disallowing separation of coprocesses.
Home node or origin site concept.
Cont… : Disallowing Separation of
coprocesses
oEasiestmethodofhandlingcommunication
between coprocesses is to disallow their separation.
oMethods :
n
n
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.
Cont…
oDisadvantage:
nIt does not allow the use of parallelism within jobs.
Cont… : Home node or Origin Sites
Concept
oUsed for communication between a process and its
sub process when the two are running on different
nodes.
oAllowsthecompletefreedomofmigratinga
processoritssubprocessindependentlyand
executing them on different nodes of the system.
Cont…
oDisadvantage:
nAllcommunicationbetweenaparentprocessandits
children processes take place via the home node.
o trafficandthecommunicationcostincreaseThemessage
considerably.
Advantages of Process Migration
oReducing average response time of processes
nTo reduce the average response time of the processes,
processes of a heavily loaded node are migrated to idle or
underutilized nodes.
oSpeeding up individual jobs
n
n
n
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.
Cont…
oGaining higher throughput
nProcess 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.
oUtilizing resources effectively
nDepending upon the nature of a process, it can be
migrated to suitable node to utilize the system resource in
the most efficient manner.
59
Cont…
oReducing network traffic
nMigratingaprocessclosertotheresourcesitisusing
most heavily.
oImproving system reliability
nMigrate a copy of a critical process to some other node
and to execute both the original and copied processes
concurrently on different nodes.
oImproving system security
nA sensitive process may be migrated and run on a secure
node.