Docsity

Process, Allocation and Migration -Distributed Systems | CS 425, Study notes of Computer Science

Partial preview of the text

Download Process, Allocation and Migration -Distributed Systems | CS 425 and more Study notes Computer Science in PDF only on Docsity!

Computer Science 328

Distributed Systems

Lecture 15

Process Allocation & Migration

Process Creation

 In DS creation of a new process has two independent

aspects:

 (^) The choice of a target processor  (^) The creation of an execution environment

 Processor allocation policies range from always

running a process at its originator host, to sharing the

processing load of a DS among all processors.

Allocation policies include:

 (^) Transfer Policy: whether to situate a new process locally or remotely;  (^) Location Policy: where to send a process selected for transfer;

One V.S. N processors

 1 Processor is more likely to be completely

functional.

 N – Processors are less likely to fail completely (fail

soft)

 The response time of a 1 Processor is better than N

processors, each 1/N th as powerful.

Response time, single processor, T = 1 / (1 + μ - λ), μ is the service rate, λ is the arrival rate (jobs/sec.)

Response time, N processors, T’ = 1 / N ( 1+ μ - λ), i.e. T’ = T / N

Processors & Queues

Job Job Job

CP U

queue

N Processors, N queues

Job Job Job

CP U

queue

Job Job

CP U

queue

Job Job Job

CP U

queue

1 Processor, 1 queue

**-

Job**^ • Job Job

queue

N Processors, 1 queue

CPU CPU

CPU

- -

A centralized Processor Allocation

 Up Down Method:

 (^) Processors earn points when they are idle for local jobs (credit for allowing others to use the processor).  (^) Processors lose points when they dispatch jobs to remote hosts.  (^) Points are accrued or spent at a time related fixed rate.  (^) When a processor becomes available, it is given to the requestor with highest credit points.  (^) The method assumes one user per processor  (^) The method favors light weight users over cpu hogs. Can’t work if all are net consumers of cpu.

Hierarchical Processor Allocation

 Instead of peer to peer model, use a hierarchical

model of processors.

 (^) workers try to maintain their load between high & low bounds.  (^) If they go above high or below low, inform their manager  (^) Managers then try to shift work among workers  (^) Similarly, managers have high and low quotas, and inform directors if too much or too little work, … and so on.  (^) Reduces communication overhead  (^) May use a “board of directors” instead of president

president

directors

managers

workers

Sender initiated Processor Allocation

 Processors with overload ask around for idle hosts.

 This can be broadcasted to all or a small group of

processors.

 Sender initiated approaches pay a high

communication cost when processors are mostly busy.

 Hybrid approaches combine receiver and sender

initiation, using watermarks for when a processor

should ask for more jobs or for help

Processor Allocation and IPC

 Inter Process Communication among processors

becomes a consideration in process allocation.

 Cooperating Processes that use IPC can benefit by

running in parallel (co scheduled)

 A different approach, GTD Scheduling, uses a

weighted graph of cooperating processes:

 (^) Edges are IPC channels, weighed by comm.  (^) Partition the graph for each processor so as to minimize the weight of the dissected edges  (^) Processes that require a lot of IPC are allocated to the same processor

Models for Process Migration

 A process has 3 segments:

 (^) Code segment – executable set of instructions  (^) Resource segment – references to external resources  (^) Execution segment – current execution state of a process (heap, stack, program counter, etc.)

 One or all segments could migrate:

 (^) Weak mobility – only code segment migrates  (^) Strong mobility – code and execution segments migrate  (^) Sender initiated base processor initiates  (^) Receiver initiated – target processor initiates

 Any part not migrated creates residual dependency

Models for Process Migration (2)

Execute at Target

Execute elsewhere

Execute at Target

Execute elsewhere

Migrate

Clone Migrate

Clone

Sender- initiated

Receiver- initiated

Sender- initiated

Receiver- initiated

Weak Mobility

Strong Mobility

Process Migration

Migration of Local Resources (2)

 Resource machine bindings:

 (^) Unattached resources: easy to move, e.g. data files associated with the process only  (^) Fastened resources: costly to move e.g. a database  (^) Fixed resources: cannot be moved e.g. local devices Process- resource

Machine-resource bindings

By Id.

By Value

By Type

unattached Fastened Fixed Move Global Ref.

Global Ref. Move Global Ref. Copy Value Global Ref.

Global Ref. Copy Value Global Ref. Rebind Move Rebind^ Copy Value

Rebind Global Ref.

Migration of Virtual Memory

 Freeze & Copy migration

suspend the process, copy all memory pages, resolve bindings, start process in new host  (^) + Clean and nice  (^) + No residual dependency  (^) Unnecessary pages are also copied  (^) Process is not running during copying

 Precopying Method

continue running the process while pages are copied, then freeze & copy modified pages.  (^) + No residual dependency  (^) some pages must be copied twice

Migration of Comm. Channels

 (^) If a process is communicating via IPC (same or remote host), comm. must also migrate.  (^) One approach is to inform all parties involved in communication of the new location  (^) + no residual dependencies  (^) difficult to keep track of all processes that are involved  (^) expensive (must send lots of messages)  (^) Another approach is by redirection (forwarding)  (^) + easy to implement  (^) + inexpensive  (^) residual dependency

 A hybrid approach, uses redirection for the first time and

informs the party of new location for future communications.

Migration in Heterogeneous Systems

 Weak mobility migration to a different platform may

require recompilation, or a VM

 Strong mobility migration to a different platform

requires proper representation of the execution

segment, in particular stack and the program counter.

 One method is to keep a migration stack

 (^) Allow migration only at subroutine call  (^) keep a machine independent copy of stack  (^) update this stack on call & exit instructions  (^) machine dependent addresses are changed to labeled jumps