21
Process Management Distributed Operating System

Process Migration

Embed Size (px)

Citation preview

Page 1: Process Migration

Process Management

Distributed Operating System

Page 2: Process Migration

Major concepts

• Process allocation

• Process Migration

• Threads

Page 3: Process Migration

Steps in process migration

• Selection of a process that should be migrated– Done through migration policy

• Selection of the destination node – Done through migration policy

• Actual transfer of the selected process– Done through migration mechanism

Page 4: Process Migration

Desirable features of good process Migration mechanism

• Transparency– Object access level– System call and IPC communication level

• Location independent

• Minimal interference – To the progress of process and system– Freezing time : time period for which the execution of the process is stopped for transferring

its info to destination node• Minimal residue dependencies

– Migrated process should not depend on its previous node• Efficiency

– Issues• Time required to migrate process• Cost of locating the object• Cost of supporting remote execution once the process is migrated

• Robustness– Failure of any other node should not affect the accessibility or execution of the process

• Communication between coprocesses– Communication directly possible irrespective of location

Page 5: Process Migration

Process Migration Mechanisms

• Subactivities– Freezing the process on its source and

restarting it on its destination– Transferring the process’s address space

from its source to destination– Forwarding messages meant for the migrant

process– Handling communication between cooperating

process

Page 6: Process Migration

Freezing and restarting process• Take snapshot of process’s state on its source node• Reinstate the snapshot on the destination node• Issues

– Immediate and delayed blocking of the process– Fast and slow I/O operations

• After process is blocked wait for completion of fast I/O operations , then process is frozen

• Slow I/O performed after migration– Information about open files

• Use of links to remote files• Use of local files as far as possible

– Reinstating the process on its destination node• Constructing a new copy in the destination

Page 7: Process Migration

Address space transfer mechanism

• Information to be transferred– Process’s state

• Execution status • Scheduling info• Info about RAM• I/O states• Objects for which the process has access rights• Info about files opened etc.

– Process’s address space (code, data & stack)• Higher in size than process’s state info• Can be transferred after migration , before or after process starts

executing• Address space transfer mechanisms

– Total freezing– Pretransferring– Transfer on reference

Page 8: Process Migration

Total freezing

• Process’s execution is stopped while transferring the address space

• Disadvantage that process may be suspended for a long time

Page 9: Process Migration

Pretransferring or precopying• Address space transferred while process is running on the source

node• After decision for migration is made process continues to execute

on source node until address space is has been transferred • Initially entire address space is transferred followed by repeated

transfers of pages modified during previous transfer so on until no reduction in number of pages is achieved

• The remaining pages are transferred after the process is frozen for transferring its state info

• Freezing time is reduced • Migration time may increase due to possibility of redundant transfer

of same pages as they become dirty while pretranfer is being done

Page 10: Process Migration

Transfer on Reference

• Process executes on destination

• Address space is left behind in source node

• Desired blocks are copied from remote locations as and when required

• Failure of source node results in failure of process

Page 11: Process Migration

Message forwarding

• Messages– Msgs received at source node after the

process stopped on its source node and not started on the destination node

– Msgs received at source node after execution of process started at destination node

– Msgs to be sent to the migrant process from any other node after process started executing on the destination node

Page 12: Process Migration

Message forwarding Mechanisms

• Mechanism of resending the message– Message type 1 and 2 are returned to sender or

dropped – Sender retries after locating the new node (using

locate operation)– Type 3 message directly sent to new node– Not transparent

• Origin site mechanism– All msgs are sent to origin site– Origin site forwards the messages– If origin site fails forwarding mechanism fails– Continuous load on the origin site

Page 13: Process Migration

Message forwarding Mechanisms

• Link traversal mechanism– Message queue is generated at origin– Msgs Forwarded to destination node– After process is migrated link is left on the

previous node– Process address has two parts process

id,last known location lof

Page 14: Process Migration

Message forwarding Mechanisms

• Link update mechanism– Processes communicate over link

independent mechanisms– During transfer phase the source node sends

link update messages to the kernels controlling all of the migrant process’s communication partners.

– Communication buffered during transfer and redirected after transfer

Page 15: Process Migration

Process migration

• Mechanism for handling coprocesses– Disallow separation of coprocesses

• Disallow separation of processes that wait for other processes to complete

• Ensure that when parent process migrates all its child process also migrates with it

– Home node origin• All communication take place via home node

Page 16: Process Migration

Process migration in heterogeneous system

• Data translation required

• External data representation as compared to direct transfer

• Serializing : process of converting from a particular machine representation to external data representation format

• Example -- Floating point representation• Exponent and mantissa

Page 17: Process Migration

Advantages of process migration

• Reducing average response time of processes

• Speeding up individual jobs• Higher throughput• Utilizing resources effectively• Reducing network traffic• Improving system reliability• Improving system security

Page 18: Process Migration

threads

• Advantages– Overheads in creating new process higher

than creating new thread– Switching between threads cheaper than

switching between processes– Threads allow parallelism– Resource sharing can be achieved

Page 19: Process Migration

Models for organizing threads

• Models for organizing threads– Dispatcher worker model– Team model– Pipeline model

• Issues in designing threads package– Threads creation– Threads termination– Thread synchronization

• Mutex variable– Lock and unlock

Page 20: Process Migration

Issues in designing threads package

• Thread synchronization– Priority assignment facility– Flexibility to vary quantum size dynamically– Handoff scheduling

• Thread to name its successor

– Affinity scheduling• Thread is scheduled on the CPU it last ran on in the hope

that part of address space is still in CPU’s cache

• Signal handling– Interrupts and exception handlers

Page 21: Process Migration

Implementing threads package

• User level

• Kernel level