2.1 Real-time Systems
2.1.4 A brief survey of scheduling algorithms
Initially, we review the theory of well-known uniprocessor scheduling algorithms. Later, we proceed towards multiprocessor scheduling algorithms.
2.1.4.1 Uniprocessor Preemptive scheduling algorithms Cyclic Executive (CE)
1. Assumptions: Set of independent periodic tasks with common arrival time and implicit-deadline.
2. Clock driven (or time driven) off-line algorithm.
2.1 Real-time Systems
3. Temporal axis is divieded into slots of equal length, in which one or more tasks can be allocated for execution, in such a way to respect the frequencies derived from the application requirements [23].
4. Duration of the time slot is called asMinor cycle, whereas the minimum interval of time after which the schedule repeats itself (the hyperperiod) is also calledMajor cycle. Minor cycle = GCD{P1, P2, ..., Pn}. Major cycle = LCM{P1, P2, ..., Pn}.
(Greatest Common Divisor (GCD): Greatest Common Divisor, Least Common Multiple (LCM): Least Common Multiple).
5. Most used approach to handle periodic tasks in defense systems due to its pre- dictability.
6. Sensitive to application changes. If updating a task requires an increase of its computation time or its activation frequency, the entire scheduling sequence may need to be reconstructed from scratch.
Rate Monotonic (RM) [73]
1. Assumptions: Set of independent periodic tasks with common arrival time and implicit-deadline.
2. Tasks with higher request rates (that is, with shorter periods) will have higher priorities. Let Γ ={τ1, τ2, ..., τn}be the set of periodic tasks ordered by increasing periods, with τn being the longest period. According to the RM, τn will be the task with lowest priority.
3. RM is a fixed-priority assignment: a priority Pi is assigned to the task before execution and does not change over time. RM is not a work-conserving algorithm.
4. Liu and Layland [73] showed that RM is optimal among all fixed-priority assign- ments in the sense that no other fixed-priority algorithms can schedule a task set that cannot be scheduled by RM.
5. Liu and Layland also derived the least upper bound of the processor utilization factor for a generic set ofn periodic tasks: Ulub=n(21/n−1), which is also known asLL-Bound. For n → ∞, Ulub =ln2 = 0.693.
6. If the given task set satisifes the LL-Bound test, then it is schedulable. However, LL-bound test is only a sufficiency test, not necessary.
7. Derivation ofUlub is based on critical instant of a task. It is the arrival time that produces the largest task response time. Worst-case response time of a task occurs when it is released simultaneously with all higher-priority tasks.
Earliest Deadline First (EDF) [73]
1. Assumptions: Set of independent tasks. Tasks can be aperiodic, periodic, sporadic.
2. Tasks with earlier (absolute) deadlines will be executed at higher priorities.
3. EDF is adynamic priority assignment. It does not make any specific assumption on the periodicity of tasks. Unlike RM, EDF is a work-conserving algorithm.
4. A set of periodic tasks isschedulable with EDF if and only if
n
P
i=1
Ci/Pi ≤1.
5. EDF doesn’t make any assumption about the periodicity of the tasks. Hence it can be used for scheduling of periodic as well as aperiodic tasks. In addition to this, EDF isoptimal among dynamic priority scheduling algorithms.
Least Laxity First (LLF) [37]
1. The laxity of a real-time task τi at time t, Xi(t) is defined as follows: Li(t) = Di(t)−Ei(t), where Di(t) is the (relative) deadline by which the task must be completed and Ei(t) is the amount of computation remaining to complete. In other words, the laxity is the time left by its deadline after the task is completed assuming that the task could be executed immediately without preemption.
2. A task with zero laxity must be scheduled right away and executed with no pre- emption to meet the deadline.
2.1 Real-time Systems
3. A task with negative laxity indicates that the task will miss its deadline. Therefore, the laxity of a task is a measure of its urgency in deadline-driven scheduling.
4. The preemptive LLF scheduling algorithm always executes a task whose laxity is least. This algorithm has beeen proved to be optimal.
Deadline Monotonic (DM) [68]
1. DM is a constrained deadline version of RM scheduling.
2. Each task is assigned astatic priority inversely proportional to its deadline Di. 3. Schedulability of a given task set can be verified by
n
P
i=1
Ei/Di ≤ n(21/n −1).
However, as we mentioned in RM, it is a pessimistic bound.
2.1.4.2 Multiprocessor scheduling algorithms
In this subsection, we briefly summarize the scheduling algorithms that can be used to schedule tasks on homogeneous as well as heterogeneous multiprocessor systems.
A comprehensive survey of multiprocessor scheduling algorithms can be found in [36].
Traditionally, schedulers for real-time tasks on multi-cores/multi processing cores make use of either apartitioned orglobal approach. In afully partitioned approach, all jobs of a task are assigned to a single processor. This approach has the advantage of transforming the multiprocessor scheduling problem to a set of uniprocessor ones. Hence, well known optimal uniprocessor scheduling approaches such as Earliest Deadline First (EDF), Rate Monotonic (RM) [73] etc. may be used. As each task runs only on a single processor, there is no penalty due to inter-processor task migrations. However, one of the drawbacks of partitioning is that the general problem is provably NP-hard both for homogeneous and heterogeneous multi-cores [26]. Recently, Baruah et al. presented anInteger Linear Program (Integer Linear Programming (ILP)) based optimal solution to the partitioning problem for heterogeneous platforms [13]. However, solving ILPs for systems with a large number of tasks and processing cores may incur prohibitively expensive computational overheads in many real-time systems.
Unlike partitioning, aglobal scheduling methodology allows inter-processor migration of tasks from one processor to another during execution. The proportional fair algorithm Pfair [14] and it’s work conserving version ERFair [7] are the first known optimal real- time homogeneous (i.e., identical) multiprocessor schedulers. Given a set of n implicit- deadline periodic tasks to be executed onm homogeneous processors, ERFair scheduler ensures that the minimum rate of progress for each task is proportional to a parameter called the task’s weightwti, which is defined as the ratio of it’s execution requirementEi and period Pi. That is, in order to satisfy ERFairness, each task τi should complete at least (Pn
i=1(Ei/Pi)×t) part of it’s total execution requirement Ei, at any time instant t, subsequent to the start of the task at time si. Following the above criterion, ERFair is able to deliver optimal/full resource utilisation; hence, any task set is guaranteed to be schedulable provided: Pn
i=1(Ei/Pi) ≤ m. However, such a strict fairness criterion imposes heavy overheads including unrestricted preemptions/migrations.
Global Scheduling on Heterogeneous Multiprocessors: Based on a global approach, the problem of optimally scheduling independent preemptive jobs on hetero- geneous multiprocessor systems is solved by Lawler et al. in [65]. The paper proposes an approach that can schedule a set of n aperiodic jobs on m heterogeneous processing cores requiring no more than O(m2) preemptions. According to [10], this result can easily be extended to optimally schedule periodic tasks. However, the resulting sched- ule is likely to contain a huge number of preemptions and interprocessor migrations, which makes it impractical. Raravi et al. [93] presented a task-to-core assignment algo- rithm for a heterogeneous platform consisting of two different types of processing cores (for example, ARM’s big.LITTLE [10]). Subsequent to the partitioning of tasks among processing cores, the heterogeneous scheduling problem is transformed to homogeneous multi-core scheduling. Then, they have applied well known optimal homogeneous multi- core scheduling techniques such as PFfair [14], ERfair [7], DPfair [45] etc. Recently, Chwa et al. extended the DPfair [45] scheduling strategy and presented a global opti- mal algorithm called Hetero-Fair for the scheduling of periodic tasks on heterogeneous multi-cores with two-types of processing cores [33].
2.2 Supervisory Control of Timed Discrete Event Systems