Outline Software Software Design Design Enrico Bini Enrico Bini - - PDF document

outline
SMART_READER_LITE
LIVE PREVIEW

Outline Software Software Design Design Enrico Bini Enrico Bini - - PDF document

Component- Component- Based Based Outline Software Software Design Design Enrico Bini Enrico Bini Design Design problem problem Component-Based Software Design Model of VM Model of VM Hierarchical Real-Time Scheduling lecture


slide-1
SLIDE 1

Component- Based Software Design Enrico Bini Design problem Model of VM

Component-Based Software Design

Hierarchical Real-Time Scheduling lecture 3/4 Enrico Bini March 24, 2015

Component- Based Software Design Enrico Bini Design problem Model of VM

Outline

1 Design problem 2 Model of VM

Component- Based Software Design Enrico Bini Design problem Model of VM

The design problem over parallel VM

Premise: the terms multi-core, multiprocessor, parallel machine, etc. are all used interchangeably, as they all are machines capable to perform computation simultaneously. What is the best VM which can schedule a given real-time application? Needed ingredients:

  • A model of a parallel VM
  • An application model
  • Local scheduler of application over VM
  • Notion of “best”
  • Optimization method

Component- Based Software Design Enrico Bini Design problem Model of VM

Outline

1 Design problem 2 Model of VM

Component- Based Software Design Enrico Bini Design problem Model of VM

Main characteristic of multicore

Resource is available along two dimensions

  • horizontal dimension over time
  • vertical dimension over the number of processing units

In short:

  • two machines of speed 0.5 and
  • one machine of speed 1

are different. Migration hypothesis:

1 migration/identical multiprocessor: the work can freely

migrate over all CPUs and it takes the same amount of time

  • reasonable as first approximation
  • in reality migration has a non-uniform (cache hierarchies)

cost

Component- Based Software Design Enrico Bini Design problem Model of VM

VM schedule

A schedule is modeled by a set of n VM schedule functions i ∈ N si : T → 2M such that ∀t ∈ T , ∀i 6= j, si(t) ∩ sj(t) = ∅ that is no machine can be used simultaneously by two VMs. Equivalently: si,k(t) schedule of i-th VM over k-th CPU at t i ∈ N, si,k : T → {0, 1} ∀t, k,

n

  • i=1

si,k(t) ≤ 1 core k at t to at most 1 VM

slide-2
SLIDE 2

Component- Based Software Design Enrico Bini Design problem Model of VM

Legal schedules

Given a global scheduling algorithm A, we denote by L∗ the set

  • f all possible legal VM scheduling functions, defined as

L∗ = {(si,k)i∈N ,k∈M : scheduling functions (si,k)i∈N ,k∈M may be generated by A}, while the set Li of legal scheduling functions for i-th VM is defined as a projection of L∗, that is Li = {(si,k)k∈M : (si,k)i∈N ,k∈M ∈ L∗}. Since we focus on one VM only, we drop the index i of the VM Li ⇒ L, si,k(t) ⇒ sk(t) k is the index of the assigned physical machine

Component- Based Software Design Enrico Bini Design problem Model of VM

Parallel supply lower bound function

Definition (parallel supply lower (bound) function of a VM)

Given a VM, we define its parallel supply lower bound function pslfk(t) with maximum parallelism k as pslfk(t) = min

t0∈T ,(s1,...,sm)∈L

t0+t

t0

min

  • k,

m

  • ℓ=1

sℓ(x)

  • dx.

[indentical hyp means sℓ] “minimum amount of resource made available by the VM in every interval of length t, with parallelism at most k”. Notice that pslfk(t) depends on

1 the length of the time interval t, and 2 the level of parallelism k,

to represent the bi-dimensional nature of the resource.

Component- Based Software Design Enrico Bini Design problem Model of VM

Parallel supply upper bound function

Definition (parallel supply upper (bound) function of a VM)

Given a VM, we define its parallel supply upper bound function psufk(t) with maximum parallelism k as psufk(t) = max

t0∈T ,(s1,...,sm)∈L

t0+t

t0

min

  • k,

m

  • ℓ=1

sℓ(x)

  • dx.

Component- Based Software Design Enrico Bini Design problem Model of VM

Properties

1 ∀k, pslfk(0) = 0 (no resource in empty interval), 2 ∀k, ∀s ≥ t ≥ 0, pslfk(s) ≥ pslfk(t) (non-decreasing) 3 ∀k, ∀s, t ≥ 0, pslfk(s + t) ≥ pslfk(s) + pslfk(t)

(super-additivity)

4 ∀k, ∀s ≥ t ≥ 0, pslfk(s) − pslfk(t) ≤ k(s − t) (Lipschitz

continuous with factor k):

5 when needed, we extend ∀k ≤ 0, pslfk(t) = 0 6 ∀k, ∀t ≥ 0, pslfk(t) ≤ pslfk+1(t) (non-decr with k) 7 (def): ¯

m = min{k : ∀t, pslfk(t) = pslfk+1(t)} is max parallelism of the VM;

8 ∀k, ∀t ≥ 0, pslfk(t) − pslfk−1(t) ≥ pslfk+1(t) − pslfk(t)

(concavity) [explanation] implies ∀k, ∀t ≥ 0,

pslfk(t) k

≥ pslfk+1(t)

k+1

[by induction]

9 pslf ¯ m(b − a) ≤

b

a

m

k=1 sk(t) dt ≤ psuf ¯ m(b − a)

Component- Based Software Design Enrico Bini Design problem Model of VM

More properties

Let us assume that at some instant t∗ we know that pslfk(t∗) ≥ c∗, (1) From Lipschitz-continuity and (1), we find ∀t ∈ [0, t∗] pslfk(t) ≥

  • 0 ≤ t ≤ t∗ − c∗

k

c∗ + k(t − t∗) t∗ − c∗

k < t ≤ t∗

Let q and r be quotient and rest of the Euclidean division of any t ≥ 0 by t∗, that is t = qt∗ + r, q ∈ N, r ∈ [0, t∗). Then, for any t ≥ 0, the following lower bound holds pslfk(t) = pslfk(t∗ + · · · + t∗

  • q times

+r) ≥ ≥ pslfk(t∗) + · · · + pslfk(t∗)

  • q times

+pslfk(r) = qc∗ + pslfk(r).

Component- Based Software Design Enrico Bini Design problem Model of VM

Examples

1 pslfk(t) of a VM with ¯

m dedicated processors?

2 pslfk(t) of a VM which provides Q budget, every period

P, with parallelism at most ¯ m?

3 pslfk(t) of a VM which provides Q1 = 4, Q2 = 2 budgets,

  • n two CPUs, every period P = 6?
slide-3
SLIDE 3

Component- Based Software Design Enrico Bini Design problem Model of VM

Examples

1 pslfk(t) of a VM with ¯

m dedicated processors?

2 pslfk(t) of a VM which provides Q budget, every period

P, with parallelism at most ¯ m?

3 pslfk(t) of a VM which provides Q1 = 4, Q2 = 2 budgets,

  • n two CPUs, every period P = 6?

[Symmetric worst-case supply pattern (idea by Artem Burmyakov)]

−10 −11 −9 −8 −7 −6 −5 −4 −3 −2 −1 1 2 3 4 5 6 7 8 9 10 11

How does it compare against Q1 = Q2 = 3 or against Q1 = 6, Q2 = 0?

Component- Based Software Design Enrico Bini Design problem Model of VM

Is even budget always worst?

If periods are not synchronized. . . (P = 8, Q1 + Q2 = 8)

2 4 6 8 10 12 14 16 18 20 22

pslf2(t) t

Q1 = 8 Q1 = 7 Q1 = 6 Q1 = 5 Q1 = 4 CPU1 CPU1 CPU1 CPU1 CPU1 CPU2 CPU2 CPU2 CPU2 CPU2