Definition
A set of tasks, pieces of work that recur, is schedulable under a scheduling policy when every occurrence of every task, called a job, finishes by its deadline, for every pattern of arrivals and execution times §9.32 that the task model allows. Schedulability is that property. A schedulability test decides it without running the system, from each task’s worst-case execution time §9.33, minimum time between arrivals and deadline. The answer belongs to the task set and the scheduler together: the same tasks can be schedulable under one policy and not under another.
The idea
A processor that is busy only 40% of the time can still miss a deadline. A task that needs 4 milliseconds (ms) of processor time and must finish within 2 ms of its release fails every time, even if it arrives only every 10 ms, so that the processor is busy of the time. Average load says how much work there is. It does not say when the work is needed or what the scheduler runs first.
Schedulability analysis therefore looks for the worst case instead of the average. Under fixed priorities, a job is delayed most when it is released at the same instant as a job of every higher-priority task, and those tasks then release new jobs as fast as they are allowed to. Liu and Layland proved this in 1973 for periodic tasks under preemptive fixed-priority scheduling, and called that instant the critical instant. A job that meets its deadline in that situation meets it in every situation the model allows.
How it works
The task model fixes the inputs. For each task :
, a bound on the worst-case execution time (WCET) of one job, the longest the job can run on the processor;
, the period, or for a sporadic task, one released at irregular times, the minimum time between two releases;
, the relative deadline: each job must finish within of its release;
for fixed-priority scheduling, the task’s priority.
The utilization of task is , the long-run fraction of processor time it can demand, and the total utilization is the sum over all tasks.
One condition is necessary under every policy on one processor: if , the tasks can demand more processor time than exists, work piles up, and some deadline is eventually missed. is not sufficient in general. Beyond that, the right test depends on the policy. The three classic cases assume one processor, preemption and independent tasks:
Earliest deadline first (EDF): always run the ready job whose absolute deadline is nearest. With deadlines equal to periods, the task set is schedulable if and only if (Liu and Layland, 1973). With deadlines shorter than periods, a processor-demand test, which checks the total work due within every interval, replaces it.
Rate-monotonic priorities: fixed priorities, where a shorter period means a higher priority. With deadlines equal to periods, for tasks is sufficient (Liu and Layland, 1973). The bound is 1 for one task, about 0.828 for two, about 0.780 for three, and it approaches as grows. A task set above the bound may still be schedulable; the test then says nothing.
Any fixed priorities, with deadlines no larger than periods: fixed-priority response-time analysis §19.4.7 computes each task’s worst-case response time and compares it with the task’s deadline. It is exact under its assumptions (Joseph and Pandya, 1986).
Fixed-priority response-time analysis. The worst-case response time of task is its own execution plus the interference from higher-priority tasks, meaning the time those tasks take the processor during the response. Starting from a critical instant, a higher-priority task releases at most jobs in a window of length , where means rounded up to a whole number, and each of those jobs costs at most . Because appears on both sides of that statement, compute it by iteration:
Start with .
Compute plus, for every higher-priority task , .
If the result equals , it is the worst-case response time: stop. If it exceeds , the task can miss its deadline: stop. Otherwise set to the result and repeat step 2.
The values never decrease from one round to the next, so the iteration either settles or passes the deadline.
This basic analysis assumes: one processor; fixed, distinct priorities; full preemption, so that a higher-priority job takes the processor as soon as it is released; independent tasks that share no locks; deadlines no larger than periods; no release jitter, meaning that every job is released exactly when it arrives; no self-suspension, meaning that a job never gives up the processor to wait for something; and scheduler and interrupt §6.11 overheads that are either zero or included in the . Extensions add a blocking term , the longest time task can wait for a lower-priority task that holds a resource task needs, and a jitter term for late releases. Priority inheritance §9.17, which lends the lock holder the priority of the highest-priority task waiting for the lock, is one protocol that keeps bounded.
Worked example
Three tasks share one processor with fixed priorities. All times are in milliseconds, and each deadline equals the period:
task 1: , , highest priority;
task 2: , , middle priority;
task 3: , , lowest priority.
The priorities are rate-monotonic. The utilization is . The Liu and Layland bound for three tasks is . Since , the utilization test is inconclusive.
Response-time analysis decides the question. Task 1 has no higher-priority task, so . For task 2, start at ; then ; then , unchanged, so . For task 3, start at :
;
;
;
;
, unchanged.
So . All three tasks meet their deadlines: the set is schedulable although it fails the utilization test.
A timeline confirms the result. All three tasks release a job at time 0. Task 1 runs from 0 to 1, task 2 from 1 to 3, and task 3 from 3 to 4. Task 1’s second job, released at 4, runs from 4 to 5, and task 3 continues from 5 to 6. Task 2’s second job, released at 6, runs from 6 to 8. Task 1’s third job, released at 8, runs from 8 to 9. Task 3 runs its last millisecond from 9 to 10 and finishes at 10, as computed.
Stated precisely
Basic fixed-priority response-time analysis. Let be the set of tasks with a priority higher than that of task . The worst-case response time is the smallest positive solution of It is found by the iteration and , where the superscript numbers the round and is not a power. The task set is schedulable exactly when for every task . This holds under the assumptions listed in How it works, with each a safe WCET bound and each a true minimum time between releases.
Utilization tests, for one processor, preemption, and independent periodic tasks with : earliest deadline first schedules the set if and only if . Rate-monotonic fixed priorities schedule the set if , where is the number of tasks. The second test is sufficient only.
With a blocking bound , the longest time task can wait for a lower-priority task that holds a shared resource, the equation becomes .
Limits and common mistakes
The inputs decide everything. An execution time taken from the largest measurement instead of a proven WCET bound, or an arrival rate that the real system can exceed, gives a correct calculation about a different system.
Utilization below 100% does not mean schedulable, as the task that needs 4 ms within a 2 ms deadline shows. Utilization above the rate-monotonic bound does not mean unschedulable, as the worked example shows.
Each theorem has its own assumptions. Shared locks need a blocking term. Tasks that wait for devices need a self-suspension analysis. Late releases need a jitter term. Cooperative scheduling §6.37, where a running job keeps the processor until it gives it up, needs a non-preemptive analysis. Several processors need multiprocessor analyses, because the one-processor results do not carry over.
Interrupt handlers §6.12 run above every task priority. Their execution, at their highest possible rate, must enter the analysis as the highest-priority tasks.
A schedulability result covers only the tasks in the model. Work outside the model, such as a logging thread added later or a callback §14.22 queued on a shared worker, takes processor time that the analysis did not count.
Schedulable is a yes-or-no statement about deadlines. It says nothing about average latency, and a schedulable system can still respond slowly when its deadlines are long.
Questions answered
What utilization or response-time analysis applies to this scheduling policy?
The analysis that applies is the one whose assumptions match the policy and the tasks; a schedulability analysis, which decides whether every job meets its deadline, is valid only within its stated model. Let be task ’s worst-case execution time, its period or minimum time between releases, and its worst-case response time. For one processor with preemption and independent tasks:
earliest deadline first (EDF), with deadlines equal to periods, is schedulable exactly when the total utilization, the sum of over all tasks, is at most 1; with shorter deadlines it needs a processor-demand test;
rate-monotonic fixed priorities, with deadlines equal to periods, pass if the utilization is at most for tasks, a test that is sufficient only;
any fixed priorities with deadlines no larger than periods need fixed-priority response-time analysis, which iterates over the higher-priority tasks and is exact.
Shared locks add a blocking term and late releases add a jitter term. Cooperative or non-preemptive scheduling, tasks that suspend themselves, and multiple processors each need their own extended analysis. Whatever the test, its inputs must be proven worst-case execution times and true minimum times between releases, including those of the interrupt handlers; otherwise the result describes a model, not the system.
Related entries: Worst-case execution time (WCET) (§9.33), Priority inversion (§9.16), Response time versus execution time (§9.32), Fixed-priority response-time analysis (§19.4.7), Priority inheritance (§9.17), Cooperative and preemptive scheduling (§6.37), Real-time system (§6.34), Duty-cycle bound versus per-request response-time bound (§19.4.6). Further reading: [86, 89].