• No results found

The schedulability analysis in this chapter is based on deadline analysis. Hence, we dedicate this section to go through this analysis in detail. To simplify the discussion, we consider traditional tasks with computation phases only. The analysis in Section 3.6 will consider 3-phase tasks. The deadline analysis is based on a basic argument that for any work- conserving scheduler, a job Jk will meet its deadline unless it is pushed by the interference of other tasks.

Definition 3. The interference refers to a time interval in which Jk is not able to execute because all processor cores are busy executing other tasks.

The job Jk is called a problem job, and the time interval [rk, tl] is called a problem window, where tl is the latest time for Jk to execute and finish by its deadline, i.e., tl = dk− ek. We use Lk to denote the problem window length, i.e., Lk = tl− rk+ 1. Since we consider a non-preemptive execution, a job will meet its deadline if it acquires a processor core at or before tl. Based on this argument, a sufficient schedulability condition can be easily established. That is, if the interference of other tasks is less than the problem window length, the problem job is guaranteed to meet its deadline. In Figure3.4, we show a task system generating an interference that prevent Jk from running at or before tl. We then have to verify that the same condition holds for each task.

In multiprocessor scheduling, the maximum interference of a task system over an in- terval of time is not always obtained when all tasks are released simultaneously, i.e., the critical instant of uniprocessor. Moreover, finding the release times which result in the maximum interference is an NP-hard problem [91, 22]. However, due to the NP-hardness nature of the problem, we note that the contribution of any task in any interval of time is

time

a b

body carry-out carry-in

Figure 3.5: The workload of a task inside a window of time [a, b].

never greater than the worst-case workload of the task in the same interval [26]. Thus, we can use the worst-case workload of all tasks Ti in the problem window of task Tk to derive an upper-bound on the interference.

The workload of Ti in a window of time [a, b] is composed of three parts as shown in Figure 3.5.

1. Carry-in: the contribution of at most one job with release time before a and deadline after a.

2. Body: the contribution of jobs with both release time and deadline inside the window. 3. Carry-out : the contribution of at most one job with release time inside the window

and deadline after b.

According to these definitions, a job with release time before a and deadline after b is considered as a carry-in job. We also assume the worst-case activation such that carry-in jobs start as late as possible and carry-out jobs start as early as possible.

In addition, assuming all tasks can have carry-in jobs has a large impact on the amount of workload and consequently, the interference. Thus, we consider a busy downward ex- tension of the problem window in which there are at most m tasks that can have carry-in jobs. The extended problem window has an earlier starting point to and shares the same endpoint tl as shown in Figure3.4. We now define to as follows.

Definition 4. We let to to denote the earliest time instant before rk such that from to to rk either all cores are busy with tasks from hp(k) or there is at least one pending task from hp(k). If such time does not exist, then we let to = rk.

Based on this definition, we have the following lemma. Lemma 1. The time interval [to, rk) is busy.

Proof. Assume a time interval inside [to, rk) which is not busy, i.e, there is at least one core idle. Definition 4 states that inside [to, rk) either all cores are busy with tasks from hp(k) or there is at least one pending task from hp(k). Since FTP global scheduling is work-conserving, both cases contradict the above assumption.

The following lemma bounds the number of tasks that can have carry-in jobs inside the problem window that starts at to.

Lemma 2. There are at most m tasks that can have carry-in jobs of which at most m − 1 tasks from hp(k).

Proof. We use to− 1 to denote the time instant before to. The complement of Definition4 states that at to− 1, not all cores are busy with tasks from hp(k) and there is no task pending from hp(k). This limit the number of tasks in hp(k) executing at to− 1 to m − 1. Furthermore, since there is no hp(k) task pending at to − 1, it follows that only tasks in hp(k) that are executing at to− 1 can have carry-in jobs. Similarly, no task in lep(k) can start executing at or after to as per Definition 4. Since it is not possible to execute more than m tasks at the same time, the lemma follows.

We note that even though the extended problem window that starts at to has the advantage of limiting the amount of carry-in jobs, finding the start point to is of pseudo- polynomial time complexity [17], given that the total utilization (U t) is strictly less than m. The authors of [64] observed that choosing a window of length Lk and starting at to is sufficient for the schedulability test. Intuitively, computing bounds on the amount of work inside a small time interval (Lk) is tighter than a large time interval (Sk+ Lk) as the amount of workload gets amortized over larger intervals [17].

We use WCI

k (Ti) and WkN C(Ti) to denote the workload of Ti in the problem window of Tk with and without carry-in, respectively. Obviously, lep(k) tasks can only have one job as carry-in workload; thus, WCI

k (Ti) = min(ei, Lk) and WkN C(Ti) = 0. In contrast, hp(k) tasks can be activated and executed inside the problem window. Thus, their workload can be computed from Figure3.6 as follows.

WkN C(Ti) =  Lk pi  ei+ min(ei, Lk mod pi) (3.1) WkCI(Ti) = min   (Lk− ei)0 pi  ei+ ei+ β, Lk  (3.2)

time (a) WN C k (Ti) time (b) WCI k (Ti)

Figure 3.6: The workload without and with carry-in. where

β = min(ei, (Lk− ei)0 mod pi− (pi− Di)). (3.3) We note that WCI

k (Ti) ≥ WkN C(Ti) by at most one complete job. Thus, we denote their difference by

Wkdif f(Ti) = WkCI(Ti) − WkN C(Ti). (3.4) Since m tasks can have carry-in jobs as in Lemma2, we take the largest m among all tasks.

Wkdif f(Γ) = X largest(m)

Wkdif f(Ti) (3.5)

The total workload of all tasks in the problem window of Tk can be bounded as follows. Wk(Γ) = Wkdif f(Γ) +

X

Ti∈Γ

WkN C(Ti) (3.6)

While Wk(Γ) bounds the volume over two dimensions, the horizontal length (interference) can be trivially bounded as:

Ik(Γ) =

Wk(Γ)

m . (3.7)

Finally, the schedulability test for each task can be established by checking Ik(Γ) < Lk. This condition has to be checked for each task to declare whether the task set is schedulable or not.

core1 core2 core3 time x1 x3 x4 x6 x5 v1 w1 v3 v5 v2 v4 v6 w3 w5 0 5 10 15 20 25 30 35 40 x2

Figure 3.7: An example of gPREM schedule for six jobs on three cores.