How rate-monotonic scheduling assigns fixed priorities

Short answer: Rate-monotonic scheduling gives a periodic task a fixed priority by its period: a shorter period gets a higher priority. On one preemptive processor, with implicit deadlines and independent tasks, a utilization at most n(2^{1/n} − 1) is a sufficient schedulability test. The bound falls toward ln 2, about 0.69, as n grows. The test is sufficient and not necessary. A task set above the bound can still be schedulable, and the exact test is response-time analysis.


What the problem actually asks

Fixed priorities are simpler than EDF’s changing deadlines. Among fixed-priority assignments, the rate-monotonic order is optimal for implicit-deadline periodic tasks: if any fixed-priority assignment meets every deadline, the rate-monotonic assignment does. The proof does not say that every task set of utilization 0.8 is schedulable. It says the worst-case utilization for which every such task set works approaches ln 2.

A single task has bound 1. Two tasks have bound about 0.828. The bound is a guarantee that does not look at the particular periods beyond their count. Response-time analysis looks at the periods and can accept a set the bound rejects.


What the algorithm guarantees

Under the classical assumptions, rate-monotonic priority order is optimal among fixed priorities, and utilization at most n(2^{1/n}−1) implies every deadline is met. The schedule is preemptive. Ties between equal periods can go either way. The bound is not a statement about EDF, which remains schedulable up to utilization 1. Extra machinery, blocking time, release jitter, and deadlines shorter than periods, must be added before the bound is used on a real system. The plain number does not include them.

Response time of task i is the smallest fixed point of r = C_i + sum over higher-priority tasks of ceil(r/T)·C. If that r is at most the deadline, the task meets it. This test is necessary and sufficient for the fixed-priority periodic model and can accept utilizations above the Liu-Layland bound.


The working steps

  1. Sort tasks by increasing period and assign priorities in that order, highest priority to the shortest period.
  2. Compute U = sum of C_i/T_i. If U is at most n(2^{1/n}−1), accept the set under the classical assumptions.
  3. If U is larger and still at most 1, do not reject yet. Run response-time analysis. The bound is sufficient, not necessary.
  4. If U exceeds 1, reject. No scheduler meets the deadlines.
  5. On each release, run the highest-priority ready job and preempt when a higher-priority job arrives. Priorities do not change with the absolute deadline.

The ln 2 limit is a sufficient-test limit, not the fraction of processor that fixed priorities can use on a favorable task set. EDF uses the whole processor. A task set scheduled by rate-monotonic priorities can be checked exactly by response times. The bound is the closed-form shortcut.


Approaches that look simpler and fail

Approach Why it fails when every set under utilization 1 is accepted
Accept any fixed-priority set with utilization 0.9 The sufficient bound is near 0.69 for large n. A set above the bound may or may not work. Utilization 0.9 is not by itself a fixed-priority proof.
Change priorities to earliest deadline and still cite the rate-monotonic bound Dynamic deadlines are EDF, which is allowed up to utilization 1. The smaller bound is what fixed rate-monotonic priorities pay.
Ignore a long critical section Blocking can push a high-priority job past its deadline. The classical bound assumed independent tasks that do not block each other.
Treat the bound as necessary Some schedulable rate-monotonic sets sit above n(2^{1/n}−1). Response-time analysis is the exact test.

Dynamic deadlines are earliest deadline first. The exact fixed-priority test is response-time analysis. Rate-monotonic scheduling is the fixed priority-by-period policy and its sufficient utilization bound.


A working example

This Python fragment assigns a higher fixed priority to the shorter period. Task A has period 2 and cost 1. Task B has period 4 and cost 1. The sufficient bound for two tasks is about 0.828, and this utilization is 0.75, so the deadlines hold. It prints met.

tasks = [("A", 1, 2), ("B", 1, 4)]  # name, cost, period
tasks.sort(key=lambda task: task[2])
jobs = []
for name, cost, period in tasks:
    for t in range(0, 4, period):
        jobs.append([t, t + period, cost, name, period])
priority = {name: i for i, (name, _, _) in enumerate(tasks)}
t = 0
while t < 4:
    ready = [j for j in jobs if j[0] <= t and j[2] > 0]
    if not ready:
        t += 1
        continue
    ready.sort(key=lambda j: priority[j[3]])
    ready[0][2] -= 1
    t += 1
    for j in jobs:
        if t > j[1] and j[2] > 0:
            raise SystemExit("missed")
print("met")

Where it is used

Rate-monotonic scheduling assigns a fixed higher priority to the shorter period. Real-time executives that use fixed priorities, and the Liu-Layland admission test, are this scheme. Linux SCHED_DEADLINE uses earliest deadline first instead of fixed rates.


When you can drop this algorithm

Drop the closed bound as a rejection test when it fails and the periods are known. Run response-time analysis before declaring the set unschedulable. Keep the bound as a quick sufficient check.


Why this stays published

We publish this so a search for rate-monotonic scheduling returns the sufficient bound n(2^{1/n}−1) and the fact that it is not necessary. Rate-monotonic scheduling assigns higher priority to shorter periods, and utilization at most n(2^{1/n}−1) is sufficient but not necessary for the deadlines to be met.

本文由 HoHo 與 AI 協作整理,最後更新於 2026 年 11 月 13 日。

Leave a Reply

Your email address will not be published. Required fields are marked *