• No results found

Schedulability Analysis Concepts

2.2 Real-Time Task Model and Constraints

2.2.3 Schedulability Analysis Concepts

In preparation for the review of scheduling policies, we next introduce a few key concepts related to temporal correctness, namely feasibility, optimality, schedulability tests, sustainability, and a set of common assumptions.

Recall that a task set is schedulable if its temporal constraints will always be satisfied (either in an HRT or SRT sense). Feasibility of task sets and optimality of scheduling algorithms are both defined in terms of schedulability. Intuitively, a task set is feasible if it is not impossible to schedule it and a scheduler is optimal if it can successfully schedule all feasible task sets. To avoid repetition, the following definitions should both be interpreted with respect to an implementation on a given platform.

Definition 2.3. A task setτis HRT (respectively, SRT)feasibleif and only if there exists a scheduling algorithmAsuch thatτ is HRT (respectively, SRT) schedulable underA.

Definition 2.4. A scheduling algorithmAisoptimalin an HRT (respectively, SRT) sense if and only if every task setτ that is HRT (respectively, SRT) feasible is HRT (respectively, SRT) schedulable underA.

Feasibility and optimality are commonly considered with respect to some restricted class of schedulers or platforms, e.g., “optimal among uniprocessor schedulers” or “feasible on a two- processor platform.”

A straightforward feasibility test is given by the total utilization. Recall that the utilizationuiis

the fraction of a processor that must be allocated toTiin order to match its average rate of execution

if jobs arrive periodically and execute forei time units each. This implies that the total utilization cannot exceed the total number of processors, as otherwise the total processor demand could outstrip the available supply.

Lemma 2.1. A set of sporadic tasksτ is feasible onmprocessors only ifusum(τ)≤m.

In the context of job sets (i.e., non-recurrent tasks), a feasibility condition that implies Lemma 2.1 was proven by Horn (1974). Leung and Merrill (1980) statedusum(τ)≤mas a feasibility condition for periodic task sets. A formal proof of Lemma 2.1 for the casem= 1was given by Baruahet al. (1990). This proof can easily be generalized tom >1and is omitted here.

The necessary condition imposed by Lemma 2.1 applies equally to HRT and SRT feasibility. HRT and SRT constraints, however, differ with regard to sufficient conditions. In the HRT case, Lemma 2.1 can in fact be strengthened to an equivalence, but only for implicit-deadline task sets.

Lemma 2.2. A set of implicit-deadline sporadic tasksτis HRT feasible onmprocessors if and only ifusum(τ)m.

Lemma 2.2 follows from the existence of HRT optimal schedulers under which any implicit- deadline task set withusum(τ)≤mis HRT schedulable (see Sections 2.3.1.2 and 2.3.3.3 below).

Unfortunately, the general case of di 6= pi is much more difficult. In fact, optimal online

scheduling of arbitrary-deadline sporadic task sets is impossible on a multiprocessor (Fisheret al., 2010). Further, a sufficient utilization-bound-based HRT feasibility test also does not exist, as there

are task sets with arbitrarily small utilizations that are not HRT feasible. For example,m+ 1tasks with parameters ei = , di = andpi = 1 +are clearly infeasible (in the HRT sense) on m

processors, yet have arbitrarily small utilization for0.

Using the total density instead of total utilization in Lemma 2.2 also does not yield a necessary HRT feasibility test, as there exist task setsτ withδsum(τ) > mthat are in fact HRT feasible on

mprocessors. For example, considerm+ 1tasksτ ={T1, . . . , Tm+1} with parametersei = 1

andpi = m+ 1for eachTi,di = 1for1 ≤ i ≤ m, anddm+1 = m+ 1. Their total density is δsum(τ) =m+m+11 , yetτ is HRT feasible onmprocessors.

Given our focus on implicit-deadline task systems, Lemma 2.2 is adequate for our purposes. See (Fisher, 2007; Fisheret al., 2010) for recent in-depth discussions of HRT feasibility of arbitrary- deadline sporadic task sets (and other, more general task models).

SRT feasibility is much simpler due to the less-strict nature of SRT correctness. In fact, Lemma 2.1 can be strengthened to an equivalence even for arbitrary-deadline task systems.

Lemma 2.3. A set of sporadic tasksτ is SRT feasible onmprocessors if and only ifusum(τ)≤m. Lemma 2.3 directly follows from the existence of SRT optimal schedulers (Devi and Anderson, 2005; Devi, 2006; Leontyev, 2010) under which any implicit-deadline task set withusum(τ)≤mis SRT schedulable (see Section 2.3.3.1 below).

Schedulability and sustainability. The purpose of aschedulability testfor a scheduling algorithm

Ais to determinea priori, that is, during the design phase, whether a task set will be schedulable underA, either in a HRT or SRT sense, when implemented on a given platform. Such a test must besafe(i.e., it may not wrongly claim task sets schedulable), but it may be pessimistic (i.e., it may return a negative result for a task set that is in fact schedulable). In the latter case, such a test is also called asufficient, but notnecessaryschedulability test. Anexactschedulablity test is both necessary and sufficient, that is, it never returns a wrong answer. Exact schedulability tests are highly desirable, but difficult to obtain.

Related to schedulability is the concept ofsustainability(Baruah and Burns, 2006; Burns and Baruah, 2008; Baker and Baruah, 2009b). Intuitively, sustainability requires that a task set that passed a schedulability test should not suddenly fail,i.e., become unschedulable, when the scheduling problem becomes “easier.” That is, a scheduling algorithmAissustainableif a task setτ that was

deemed schedulable underAremains schedulable even ifτ is modified,potentially during runtime, in any of the following ways:

• a periodpi is enlarged;

• an execution requirementei is reduced; or • a relative deadlinediis increased.

In other words, τ must remain schedulable underA when the utilization or density of any task is (temporarily) reduced. This is very important in practice because task parameters are typically determined such thateiis an upper bound, whereaspianddiare lower bounds. From an engineering

point of view, all schedulers used in practical systems should thus be sustainable. The concept of sustainability can similarly be applied to schedulability tests (Baruah and Burns, 2006; Burns and Baruah, 2008; Baker and Baruah, 2009b). We make heavy use of sustainability with respect to changes in the execution requirementeiin Chapters 3, 5, 6, and 7.

The definition of sustainability allows a task setτ that passed a sufficient schedulability testT

tofailT after having been modified in one of the ways listed above (unlessT is an exact test). That is, under a sustainable scheduler,τ must remain schedulable if turned into an “easier” task setτ0, but

a schedulability test that deemedτ schedulable is not required to identifyτ0 as schedulable, too. A

stricter notion of sustainability isself-sustainability(Baker and Baruah, 2009b). A schedulability test

T is self-sustainable if every task setτ that passedT still passesT after a reduction in density or utilization of any task inτ. If a schedulability test is not self-sustainable, then a system designer may be faced with the counterintuitive situation that a once-schedulable system design cannot be shown to be correct after it was simplified—in other words, a non-self-sustainable schedulability test can cause a failure invalidation, but cannot lead to aruntimefailure. While self-sustainable schedulability tests are desirable, non-self-sustainable tests are less problematic than unsustainable scheduling algorithms because they do not result in incorrect systems (but they may result in increased pessimism). There are a number of useful schedulability tests for which it is not known (in the published literature) whether they are sustainable (see Section 2.3.3.1 below).

Common assumptions. We review a number of relevant scheduling algorithms and associated schedulability tests in the subsequent sections. Most schedulability analysis results make a number of

standard simplifying assumptions. To avoid repeating these for each schedulability test, we assume the following task behavior unless noted otherwise.

1. All tasks are independent: tasks do not share any resources besides the processor(s).

2. Jobs do not self-suspend: pending jobs are always ready to execute when allocated a processor by the scheduler.

3. Jobs are always preemptive: scheduling decisions can be enacted at any time.

4. The task invocation sequence is legal: all job releases of eachTiare separated by at leastpi

time units and no job ofTi requires more thaneitime units of processor time to complete. 5. All runtime overheads (such as those caused by job migrations, scheduling decisions, context

switches,etc.) are negligible.

Each of these assumptions is to some degree problematic in practice. In fact, as discussed in detail in Chapter 1, a driving motivation underlying the research presented herein is to remove Assumptions 1 and 5 by integrating predictable resource-sharing protocols and by accounting for runtime overheads prior to schedulability analysis. Nonetheless, we shall first describe the scheduling algorithms and their schedulability tests assuming idealized task behavior, and describe how to remove these assumptions in subsequent sections and chapters.