2.4 Real-Time Scheduling
2.4.2 Scheduling Concepts
Given a system and a tasksetT, acorrect scheduleis one that allocates a processor to a taskTi ∈Tfor exactlyCitime units in the interval(︀Si+kPi,Si+kPi+Di)for allk∈N0,
with the restriction that a task may not execute on more than one processor at the same time. The schedule itself can be constructed eitheroffline(i.e., at system design- time) oronline(i.e., at system run-time). Offline scheduling allows the designer to perform computationally expensive optimizations to produce the best possible schedule
2.4. Real-Time Scheduling 31
according to some criteria (e.g., minimizing energy). However, offline scheduling lacks the flexibility to deal with new events at run-time. In contrast, online scheduling can deal with such new events at run-time. However, online scheduling introduces extra overheads due to the scheduling decisions taken during run-time. In the rest of this dissertation, we assume online scheduling algorithms unless we explicitly mention otherwise.
According to [DB11], real-time multiprocessor scheduling algorithms can be viewed as attempting to solve two problems:
• Thepriority assignmentproblem: when and in what order with respect to other tasks, each job should execute.
• Theallocationproblem: on which processor a task should execute and whether a task can migrate between processors.
As a result, real-time multiprocessor scheduling algorithms can be classified based onpriorityas follows [DB11]:
• Fixed task priority: Each task has a single priority that is used for all its jobs. • Fixed job priority: The jobs of a single task may have different priorities, however,
each job has a single priority. An example of an algorithm using this policy is the Earliest Deadline First (EDF, [LL73]) algorithm.
• Dynamic priority: A single job might have different priorities during the course of its execution. An example is the Least Laxity First (LLF) algorithm.
Based onallocation, algorithms can be classified as follows [DB11]:
• No migration: Each task is allocated to a processor and no migration is permitted. • Task-level migration: The jobs of a task may execute on different processors,
however, a single job can only execute on a single processor.
• Job-level migration: A job may execute on more than one processor, however, it may not execute on more than one processor at the same time.
A scheduling algorithm that does not permit migration at all is said to be apartitioned scheduling algorithm, while an algorithm that permits all tasks to be migrated between all processors is said to be aglobalalgorithm, and finally an algorithm that permits a subset of tasks to be migrated among a subset of processors is said to be ahybrid algorithm.
Graham in 1969 [Gra69] showed that a system may exhibit unexpected scheduling “anomalies” even though the system operates under a “better” set of conditions. For example, he showed that decreasing the WCET of tasks may result in an increase in the schedule length. Such anomalies are known in the literature asGraham’s anomalies(or scheduling anomalies). A scheduling algorithm under which scheduling anomalies can never occur is said to beanomaly-free[AJ02]. Examples of anomaly-free unipro- cessor scheduling algorithms include EDF and fixed-task priority scheduling with rate monotonic priority assignment. Partitioned multiprocessor scheduling algorithms in
32 Chapter 2. Background
which each processor is scheduled using an anomaly-free uniprocessor scheduling algorithm are known to be anomaly-free as well [AJ02].
In this dissertation, we focus only on partitioned scheduling due to the following reasons: (1) task migration on distributed-memory MPSoCs has a non-negligible overhead, (2) partitioned scheduling has been shown to be the most suitable type for hard real-time systems [Bra11], and (3) partitioned scheduling where each processor is scheduled using an anomaly-free uniprocessor scheduling algorithm is anomaly-free as mentioned earlier.
A tasksetTis said to befeasibleon a system if there exists a scheduling algorithm that can construct a correct schedule forTon the system. A tasksetTis said to be schedulableusing a scheduling algorithm𝒜if𝒜can construct a correct schedule for Ton the system. Finally, a scheduling algorithm𝒜is said to beoptimalwith respect
to a task model and a system if and only if it can schedule all tasksets that comply with the task model and are feasible on the system.
On uniprocessor systems, EDF scheduling is known to be optimal for all periodic tasksets [But11]. On multiprocessor systems, several global and hybrid algorithms are known to be optimal for implicit-deadline periodic tasksets (e.g., [BCPV96, CRJ10, FLS+11, RLM+12]) and, in contrast, optimal online scheduling of constrained-deadline tasksets is impossible [FGB10]. Finally, partitioned scheduling is known to be non- optimal for periodic tasksets [CFH+04].
Aschedulability testfor a scheduling algorithm𝒜decides, given a task setT,
whetherTis schedulable using𝒜. Schedulability tests can be classified further into
[DB11]:
• Sufficient: If all tasksets that are deemed schedulable by the test are in fact schedulable.
• Necessary: If all the tasksets that are deemed unschedulable by the test are in fact unschedulable.
• Exact: If the test is both sufficient and necessary.