• Tidak ada hasil yang ditemukan

Non-preemptive Scheduler Synthesis Framework

ALGORITHM 3: NON-CO-REACHABLE Input: M , The set of co-reachable states Q 0

3.2 Non-preemptive Scheduler Synthesis Framework

of sporadic tasks.

Table 3.1 provides the summary of qualitative comparison between the state-of-the- art SCTDES based uniprocessor scheduling schemes. Although the scheduler synthesis approaches presented in [85, 87] attempt to handle sporadic tasks, they fail to correctly model minimum inter-arrival time constraint. In this chapter, we present scheduler synthesis framework which has the ability to correctly model sporadic tasks.

Table 3.1: Comparison between SCTDES based uniprocessor scheduling schemes

Method Tasks Preemptive /

Non-preemptive Remarks

[29] Periodic Non-preemptive It considers non-preemptive periodic tasks.

[53] Periodic Both It considers both preemptive & non-preemptive tasks.

[105] Periodic Preemptive It considers tasks with multiple periods.

[106] Periodic Conditionally

preemptive It considers conditionally preemptive tasks.

[85] Sporadic Preemptive It does not capture minimum inter-arrival time constraint of sporadic tasks.

[87] Periodic,

Sporadic Preemptive It does not correctly model periodic as well as sporadic tasks.

Section 3.2 Aperiodic,

Sporadic Non-preemptive It correctly captures minimum inter-arrival time constraint of sporadic tasks.

Section 3.3 Sporadic Preemptive It correctly captures minimum inter-arrival time constraint of sporadic tasks.

3.2 Non-preemptive Scheduler Synthesis Framework

In this section, we present the synthesis framework for the design of an optimal non- preemptive scheduler for a set of: (i) aperiodic tasks with known arrival times, (ii) dynamically arriving aperiodic tasks, and (iii) dynamically arriving sporadic tasks.

3.2.1 Aperiodic Tasks with Known Arrival Times

System Model: We consider a real-time system consisting of a set I (= {τ1, τ2, ..., τn}) of n (≥ 1) non-preemptive, aperiodic tasks to be scheduled on a uniprocessor [31, 47, 54, 54]. Formally, the task τi to be scheduled is represented by a 3-tuplehAi, Ei, Dii, where Ai is the arrival time, Ei is the execution time and Di is the relative deadline of τi.

Assumptions: (1) Tasks are independent with no precedence constraints [30]. (2) Execution time for each task is constant and equal to its worst-case execution time WCET [73]. (3) Ei ≤ Di for all tasks in I. (4) All tasks are reported to the scheduler

which then controls their execution on the uniprocessor according to the pre-computed off-line scheduling policy.

3.2.2 Task execution model

0

∑\

(∑iU{t})

ai si

4 5 t 6 ci

# t = Ei

1 t

∑\

(∑iU{t})

2

∑\

(∑iU{t})

t t 3

∑\∑i

# t = Ai

uc\ {ai}

uc\ {ai}

uc\ {ai}

7

∑\∑i

Figure 3.1: Task execution modelTi for task τi hAi, Ei, Dii.

The TDES model Ti for executing a non-preemptive, aperiodic taskτi hAi, Ei, Diiis (shown in Figure 3.1) defined as,

Ti = (Qi, Σ, δi, q0, Qm),

where, Qi = {0,1, ...,7}1, q0 = 0, Qm = {7}, Σ = ∪i∈{1,2,...,n}Σi ∪ {t}, where Σi = {ai, si, ci}. The events are described in Table 3.2 and they are categorized as follows: (i) Σuc=∪i∈{1,2,...,n}{ai}, (ii) Σc = Σ\(Σuc∪{t}), (iii) Σf or = Σc. Since the arrival events of tasks are induced by the environment, they are modeled asuncontrollable events. Apart from Σuc and tick event (t), remaining events in the system are modeled as controllable events. These controllable events are also modeled asforcible events which can preempt the tick event (t). All events in Σ are considered to be observable.

Table 3.2: Description of events (for non-preemptive execution)

Event Description ai Arrival of a taskτi

si Start of execution ofτi

ci Completion of execution ofτi

State 0 is the initial state ofTi and represents the state in which taskτi resides prior to the start of the system. Events in the self-loop Σ\(Σi∪ {t}) may be characterized

1The states are numbered sequentially starting from 0, for illustration purpose. However, the total number of states inTi for a given task τi will vary depending on its execution time.

3.2 Non-preemptive Scheduler Synthesis Framework

as follows: Since τi has not yet arrived, the events that are associated with τii) are excluded from Σ. To elaborate, the self-loop contains the events such as arrival, start of execution, and completion with respect to any other task (τj ∈I, j 6=i) in the system.

Thus, Σ\(Σi ∪ {t}) does not impose any restriction on the execution of other tasks.

State 0 is replicated Ai times in order to measure the occurrence of Ai ticks subsequent to system start.

After the occurrence of ai at Aith

tick, Ti reaches State 3 from State 2. Here, the scheduler takes a decision whether to immediately allocate the task τi for execution on a processor or make it wait on the ready queue. The latter is indicated by the self- loop transition Σ\Σi at State 3. If the scheduler decides to start the execution of τi, then it will enable the event si to assign τi for execution on the processor. According to Figure 3.1, if event si occurs at State 3, then Ti reaches State 4. At State 4, the self-loop transition Σuc\ {ai} ensures that only arrivals (barring that of τi) but not the execution of tasks other than τi are allowed. This is because τi has already started its non-preemptive execution on the processor. After the elapse of Ei ticks from State 4, Ti reaches State 6. Finally, the event ci which is used to mark the completion of τi’s execution, takes Ti to the marked state State 7. Now, Ti continues to stay at State 7 without imposing any constraint on other tasks currently executing on the processor.

It may be noted that τi consumes exactly Ei ticks from the start of its execution at State 4. However, τi may miss its deadline based on the amount of time spent in the ready-queue at State 3. Suppose τi stays at State 3 for x ticks before si, then (i) τi is deadline-meeting if (x+Ei) ≤ Di, (ii) τi is deadline-missing if (x+Ei) > Di. Hence, Lm(Ti) contains both deadline-meeting as well as deadline-missing execution sequences for task τi. Now, let us formally introduce the notion of a deadline-meeting sequence as it is relevant for our discussion.

Definition: Deadline-meeting sequence (with respect to non-preemptive execution):

A sequence s = s1ais2cis3 ∈ Lm(Ti), where s1, s3 ∈ Σ, s2 ∈ (Σ\ {ci}) is deadline- meeting, if tickcount(s2)≤ Di. Otherwise,s is a deadline-missing sequence.

Example: Now, we illustrate the generalized task execution model discussed above

using an example. Let us consider an example (adopted from [23]) uniprocessor system consisting of two tasks τ1h0,4,7i, τ2h1,2,4i. The task execution models T1 for τ1, T2 for τ2 are shown in Figures 3.2(a) and 3.2(b), respectively. It can be observed that the arrival ofτ1 (i.e.,a1) takes place at system start. Onceτ1 has started execution (i.e., s1), it consumes exactly 4 ticks to complete its execution (i.e., c1). During τ1’s execution, only the arrival ofτ2 is allowed until its completion which is modeled by the self-loopsa2 at states 2 through 6. Similarly, it can be observed from Figure 3.2(b) that the arrival of τ2 takes place at the first tick subsequent to system start and it takes 2 ticks to complete

its execution after the start of its execution.

a1 s1 2 3 t 6 c1

# t = 4

0 t

∑\(∑1U{t})

1

∑\∑1

7

∑\∑1 a2 a2

4

a2 5

a2

t t

a2

a2 s2 3 4 t 5 c2

# t = 2

1 t

∑\(∑2U{t})

2

∑\∑2

6

∑\∑2

a1 a1 a1

0

∑\(∑2U{t}) t (a):

(b):

# t = 1

00 a1 10 11 12

t a2

s2 13

s1 20

t 31a2 32

21a2 22

s1

s1

t

t 42 t 52 t 62 (c):

t 14 t 15c2 16 s1 26 t 36 t 46 t 56 t 66

72 73 74 75

76

c1 s2 t t

c2 c1 t

t

t

t

Figure 3.2: TDES Models: (a) T1 for τ1, (b) T2 for τ2, (c) T =T1||T2

Based on the above approach, we construct the TDES models for all the naperiodic tasks in the system. Given thesenindividual TDES task modelsT1,T2, ...,Tn, a product composition T = T1||T2||...||Tn on the models gives us the composite model for all the tasks executing concurrently.

Remark 3.2.1. (i) The marked behavior Lm(T) represented by the composite task execution model includes both deadline-meeting as well as deadline-missing execution sequences for all tasks in I. (ii) It may be observed that Ti allows only one task for execution on the processor at any instant (which satisfies resource constraint). Specifi- cally, whenτi has started its execution (i.e.,si) atState 3, only the arrival of other tasks

3.2 Non-preemptive Scheduler Synthesis Framework

00

a

1 10 11 12

t a

2

s

2 13

s

1 20

t

31

a

2 32 21

a

2 22

s

1

s

1

t

t

42

t

52

t

62

T:

t

14

t

15

c

2 16

s

1 26

t

36

t

46

t

56

t

66

72 73 74 75

76

c

1

s

2

t t

c

2

c

1

t

t

t

t

t t

0 1 2 3 4 5 6 7 8

τ

1

τ

2

t t

0 1 2 3 4 5 6 7 8

τ

1

τ

2 Deadline miss

seq

1

:

seq

1

= a

1

s

1

t a

2

t t t c

1

s

2

t t c

2

(Deadline-missing)