Docsity

Distributed Process Scheduling: Precedence, Communication, and Disjoint Process Models - P, Study notes of Computer Science

Toggle sidebar
bg1
CHAPTER 5: DISTRIBUTED
PROCESS SCHEDULING
Chapter outline
•Three process models:
–precedence
–communication
–disjoint
•System performance model that illustrates the relationship among
–algorithm, scheduling, and architecture
•Scheduling:
–Static scheduling: precedence model, communication model
–Dynamic scheduling: load sharing, load balancing
–disjoint process model
–interacting process model
•Implementation:
–remote service and execution
–process migration
•Real-time scheduling and synchronization
–basic RTS
–Priority Inversion
–Blocking
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Distributed Process Scheduling: Precedence, Communication, and Disjoint Process Models - P and more Study notes Computer Science in PDF only on Docsity!

CHAPTER 5: DISTRIBUTED

PROCESS SCHEDULING

Chapter outline

  • Three process models:
    • precedence
    • communication
    • disjoint
  • System performance model that illustrates the relationship among
    • algorithm, scheduling, and architecture
  • Scheduling:
    • Static scheduling: precedence model, communication model
    • Dynamic scheduling: load sharing, load balancing
    • disjoint process model
    • interacting process model
  • Implementation:
    • remote service and execution
    • process migration
  • Real-time scheduling and synchronization
    • basic RTS
    • Priority Inversion
    • Blocking

Process models

process model process model process model

(a) Precedence (b) Communication (c) Disjoint

Note: Dashed lines represent processor boundaries

  • Precedence Process Model
    • Precedence relationship represented best by DAG
    • Suitable for Fork/Join or CoBegin/CoEnd code
    • Communication costs incurred if arc crosses processor boundary
    • Goal: Minimize makespan
  • Interacting Process Model
    • Persistent processes that exhange messages asynchronously
    • Represented by graph showing processes and communication paths
    • Communication costs incurred if message crosses processor bound- ary
    • Goal: Minimize computation and communication costs
  • Disjoint Process Model
    • Processes can run independently
    • Processes arrive independently
    • Queuing time and service time
    • Goal: Minimize turnaround time/processor idle time
    • If process migration, get load sharing/balancing at migration cost

Ideal speed-up

Si =

RC

RP

× n

RP =

∑m i=1 Pi OSP T

RC =

∑m i=1 Pi OCP Tideal × n

  • Si = ideal speedup on an n processor sytem
  • RC = Relative Concurrency (processor utilization) ≤ 1
  • RP = Relative Processing requirement ≥ 1
  • n = number of processors
  • m = number of tasks
  • Pi = Computation time of task i

System degradation

Sd =

1 + ρ

ρ =

CP T − OCP Tideal OCP Tideal

  • Sd = System degradation
  • ρ = loss of parallelism on a real machine

optimal scheduling

ρ

ρ (^) sched

ρ

ρ

syst (^) syst

sched

ρ

nonoptimal

nonoptimal

ideal system with

real system with

scheduling

real system with optimal scheduling

ideal system with

scheduling

Finally,

S =

RC

RP

×

1 + ρ

× n

Static scheduling - Precedence process model

A/6 B/5 C/

D/6 E/6 F/

G/

1

4 3 3 (^1 )

1 2 1

0 2 0

1 1

P

P

P

0

(a) Precedence process model (b) Communication system model

P

P

P

A/6 D/6 G/

B/5 F/

C/

7

2 E/6 4

P

P

P

A/

B/

C/

2

2

10

D/

F/

E/

10 G/

17

8

A/6 E/

B/

C/

2 D/

4 F/4 6

G/

6

1

P

P

P

(c) ETF

(b) ELS

(a) LS

Makespan = 18

Makespan = 28

Makespan = 16

Note that List Scheduling has a lower makespan because it does not charge for communication costs at all (it represents a best case). Also note that LS, Extended LS, and Earliest Task First are heuristics, and may not give an optimal schedule.

Communication process model

1 2

3

4

5

6

6

8 4

12

11

12

3 5

(a) Computation cost (b) Communication cost

Process 1 2 3 4 5 6 5 2 4 6 5 infinity

4 3 2 4

infinity

10

Cost on A Cost on B

1

2

3

4

5

6

6

8 4

12

11

12

3 5 2

3

4

10

4

inf. inf.

2

5

4 6

5

Cut Set Cost = 38

A B

For min-cut algorithms, see http://en.wikipedia.org/wiki/Ford-Fulkerson algorithm, and http://en.wikipedia.org/wiki/Edmonds-Karp algorithm

Dashed line = cost to run task on other processor (Task T in same set as A runs on A, so total cost must include cost of running T on A.)

Cluster tasks by Communication Threshold C Limit # tasks (or computation cost) on processor by Task Threshold X

Objective: minimize cutset cost, representing aggregate cost (communication plus processing). May lead to significant imbalance in processor loads.

Hybrid algorithms and their performance

  • Push: Best at low to moderate loads, unstable at high loads
  • Pull: Best at higher loads, never unstable
  • Hybrid: Sense system load, select algorithm accordingly
  • Brokered: Server to hold load info, schedule jobs

System Load

Turnaround Time

receiver−initiated

sender−initiated

algorithm

algorithm

no load sharing

M/M/

Remote process implementation

Remote service

  • As remote procedure calls at the language level
  • As remote commands at the operating system level
  • As interpretive messages at the application level

Remote execution

The remote operation initiated by a client is created by the client for resource or load sharing (processor-pool model).

  • Load sharing algorithm
  • Location independence
  • System heterogeneity
  • Protection and security

Real-time scheduling

Soft/hard deadlines, periodic/aperiodic, priority scheduling

Task τi described by τi = (Si, Ci, Di)

Si = earliest start time Ci = worst case execution time Di = deadline

(Aperiodic) Realtime Task Set V is

V = {τi | i = 1, 2 , ..., n}

Periodic Realtime Task Set V is

V = {Ji = (Ci, Ti) | i = 1, 2 , ..., n}

Ci = worst case execution time Ti = period

Schedule A is set of execution intervals

A = {(si, fi, ti) | i = 1, 2 , ..., m}

si = start time of interval i fi = finish time of interval i ti = task executed during interval i

A is valid iff:

  1. ∀i = 1, 2 , ..., m, si ≤ fi
  2. ∀i = 1, 2 , ..., m, fi ≤ si+
  3. ∀i = 1, 2 , ..., m, if ti = k, then Sk ≤ si and fi ≤ Dk

A schedule A is feasible iff every task receives at least Ck time in A A RT Task Set V is feasible iff there is a feasible schedule for it.

Priority scheduling

  • Rate monotonic priority assignment: task period
  • Deadline monotonic priority assignment: deadline
  • Earliest deadline first: dynamic deadline

Static Priority Assignment

Critical Instant

t t+T^ t^ t+T

Time t

Critical instant for

4

τ 3

τ

τ 2

τ 1

l

t ε

τ h τ h

Release τ h at t+ ε Release τ h at

l

τ 5

τ 5

Scheduling a higher priority task earlier or later can only make its demand on the processor less.

A sufficient (but not necessary) condition for feasible RM schedule, Load L is:

L =

∑^ n

i=

Ci Ti

≤ n(2^1 /n^ − 1)

which approaches 0.69 as n becomes large. This is pessimistic.

Response time ri of task i must satisfy:

ri = Ci +

i∑− 1

h=

ri Th

⌉Ch ≤ Ti

Find ri iteratively (start with ri(0) = Ci), and if ever ri(k) > Ti for some iteration k, then fail. If ri(k) = ri(k − 1) <= Ti for some iteration k, then we have reached a fixed point and the RM schedule is feasible.

Deadline Monotonic (DM) priority assignment

When periodic task deadlines are sooner than next start time

V = {Ji = (Ci, Ti, Di) | i = 1, 2 , ..., n}

Ci = worst case execution time Ti = period Di = incremental deadline (if arrive at t, must finish by t + Di)

Dh < Di then P rh > P ri

Optimal for static priority assignments for short deadline periodic tasks

Earliest Deadline First (EDF) priority assignment

Optimal dynamic scheduling

dh(j) < di(k) then P rh(j) > P ri(k)

dh(j) = deadline for jth^ instance of task h P rh(j) = priority for jth^ instance of task h

Direct and Push-through Blocking: τh suffers direct blocking; τm suffers push-through blocking due to PIP (this is desired).

S S

S S

lock unlock

lock unlock

l

m

τ h

τ

τ

Let us find Bh = maximum time τh will be blocked

Task-oriented perspective:

Bh ≤

∑

{l|P rl<P rh}

Eh(l)

Eh(l) = maximum execution time of any critical section in Blh(l) Blh(l) = set of all critical sections of τl that can block τh (directly, indirectly, or push-through)

Lock-oriented perspective: Since a higher priority task can only be blocked once by a lower priority task per semaphore S, Bh ≤

∑

{S|ceil(S)≥P rh}

Eh(S)

Eh(S) = maximum execution time of any critical section of a task with lower priority than τh that can block τh through S Priority ceiling of S, ceil(S) = max{P rh|τh can be blocked by S}. If no nested critical sections, then ceil(S) = max{P rh|τh locks S}.

So, for schedulability, take the smaller upper bound Bh. A sufficient condition for a feasible RM assignement is then:

∑^ h

j=

Cj Tj

Bh Th

≤ h(2^1 /h^ − 1)

More specifically, compute response time ri for each task i iteratively:

ri(0) = Ci + Biri(k + 1) = Ci + Bi +

∑^ i−^1

h=

ri(k) Th

⌉Ch ≤ Ti

If ever ri(k) > Ti for some iteration k, then fail. If ri(k) = ri(k − 1) <= Ti for some iteration k, then we have reached a fixed point and the RM schedule is feasible.

However, we are allowing a task to be blocked by more than one lower priority task or lock, making schedulability less certain....