• No results found

Baseline Analysis

In document Cache-Aware Real-Time Virtualization (Page 130-133)

4.6 Numerical evaluation

4.6.1 Baseline Analysis

For the baseline, since no existing overhead-aware analysis can be directly applied to

gFPca, we used an extension of existing approach that works as follows: first inflates

the WCET of each task τi (i > 1) with the total overhead it experiences during an

entire execution of a job and then applies gFPca’s overhead-free analysis.

This baseline method performs WCET inflation based on the cache overhead

∆i that each task τi incurs upon resuming from a preemption. However, instead

of inflating the WCET of each high-priority task with the maximum of one cache overhead of its lower-priority tasks (which is unsafe), it inflates the WCET of each

τi with its total cache overhead (i.e., the overhead it experiences during the entire

execution of a job).

Computing the total overhead of τi: The cache overhead that τi experiences

when it resumes from a preemption is upper bounded by∆i ≤PRT× |UCPi|. Since

a cache partition ofτi may be evicted from the cache only when another taskτj uses

the same cache partition, we can tighten∆i by considering the cache partitions used

by other tasks:

Lemma 4.12. The cache overhead a task τi experiences when it resumes from

one preemption is upper bounded by ∆i = PRT × |UCPi ∩ ∪j6=iECPj| ≤ PRT ×

min{|UCPi|,Pj6=i|ECPj|}.

Proof. When a task τi is preempted, any other executing task τj may access and

pollute the cache partitions in ECPj that may be used later by τi.

If | ∪j6=i ECPj| ≥ A, then the other tasks may collectively evict out all cache

partitions of the cache. Therefore, |UCPi ∩ ∪j6=iECPj| = |UCPi|. Because ∆i ≤

If | ∪j6=i ECPj| < A, then the cache partitions of all tasks except for τi can be

accommodated in the cache. Each job of τj will always use the cache partitions in

ECPj, because the latter job of τj may benefit from the cache partitions loaded by

the previous job ofτj. Therefore, the set of cache partitions of the task set∪j6=i{τj}

is ∪j6=iECPj. Because a useful cache partition of τi will not be evicted unless the

same cache partition is used by other tasks when τi is not executing, the maximum

number of useful cache partitions of τi that may be evicted during the preemption

of τi is upper bounded by |UCPi ∩ ∪j6=iECPj|. The maximum cache overhead τi

experiences when it resumes is PRT× |UCPi∩ ∪j6=iECPj|.

Given two setsAandB, we have|AB| ≤ |A|+|B|and|AB| ≤min{|A|,|B|}.

Therefore, it is easy to derive that∆i ≤PRT×min{|UCPi|,

P

j6=i|ECPj|}.

To bound the total cache overhead of τi, we next derive the maximum number of

times thatτi resumes (i.e., number of resumption events ofτi) in each job’s execution.

Lemma 4.13. A task τi resumes only when one of the following two events hap-

pens: a higher-priority task of τi finishes its execution, or a higher-priority task of

τi releases a new job.

Proof. A task τi resumes only when τi can acquire the CPU or cache resource that

were preempted by higher-priority tasks. A higher-priority task τl can release the

CPU and/or cache resource to τi when it finishes its execution or when it releases a

new job and preempts a medium-priority task, which will then release the resources thatτi needs. Although there exist other two cache-related task events in the system,

i.e., the task-preemption event and the task-migration event, neither of them is the source event that may release the CPU or cache resource to τi. Hence, the lemma

holds.

Lemma 4.14. The maximum number of task-resumption events of τi during each

period is at most NSi =

P

j<i2d

di

Figure 4.6: Task resumption event is caused by task release event or task finish event

Proof. Suppose a tasksetτ ={τ1 = (7,1,7,2), τ2 = (8,1.7,8.3), τ3 = (10,1.8,10,2)}

is scheduled by the gFPca algorithm on a platform with two cores and four cache

partitions. The release and scheduling patterns of the three tasks are illustrated in Fig. 4.6. Under gFPca, the priority order of the three tasks is τ1 > τ2 > τ3.

As illustrated in the figure, task τ3 resumes at t = 2 when the higher-priority task τ1 releases a new job and at t = 4 when the higher-priority task τ2 finishes its execution. We observe that both the task-release event and the task-finish event of a higher-priority task may cause τi to resume from a preemption.

Based on this observation, the number of task-resumption events of τi will be

no more than the total number of task-release events and task-finish events of its higher-priority tasks. Because a higher-priority task τj has at most ddpi

je jobs whose

release time and finish timeare in the problem window of τi, one carry-in job whose

Figure 4.7: Number of task resumption event in worst case

in the problem window ofτi (based on the worst-case scenario in Fig. 4.7), the total

number of the task-resumption events ofτi in each of its periods is upper bounded by 2ddi

pje+ 2. By combining the number of task-resumption events ofτi that are caused

by each higher-priority task in the problem window of τi, we obtain the lemma.

Since τi only incurs (extrinsic) cache overhead whenever it resumes, the total

overhead of τi is therefore at most NSi×∆i.

Overhead-aware analysis: Since the total overhead ofτi is at most NSi×∆i, the

WCET of τi in the presence of cache overhead is at most e0i =ei +NSi ×∆i. As a

result, the overhead-aware analysis can be established by applying the overhead-free analysis on the inflated workload.

In document Cache-Aware Real-Time Virtualization (Page 130-133)