Section 19.4.6

Duty-cycle bound versus per-request response-time bound

Definition

A duty-cycle bound is an upper limit on the share of time that some work may use a resource, for example at most 10 ms of processor time in every 100 ms, a duty cycle of 10%. A per-request response-time §9.32 bound is an upper limit on the time each single request may take from its arrival to its completion, for example 20 ms. The difference that matters: a duty-cycle bound caps consumption and promises no service at all, so on its own it never implies a response-time bound.

Where it fits

Main entry: Response time versus execution time (§9.32).

The Response time versus execution time entry splits a request’s response time into execution, the time a processor spends on the request, and waiting. A processor-time budget is a duty-cycle bound: it caps execution and says nothing about waiting. A scheduler that never runs the work at all complies with the cap. Nor does the cap fix the order of work. A request that needs 1 ms of processor time and arrives just after a 100 ms item has started, in the same first-in, first-out §14.14 queue, completes about 100+1=101100 + 1 = 101 ms after arriving, while the work as a whole stays within a budget of 200 ms per second.

A deadline guarantee needs five further facts.

  1. Bounded arrivals: at most a known amount of work arrives in any interval, as a token bucket §19.4.1 (a counter of credit with a rate and a burst size) can enforce, so the backlog ahead of any request is bounded.

  2. Bounded execution: each request’s processor time is at most a worst-case execution time §9.33 bound, a proven upper limit, not an average measurement.

  3. Guaranteed service: a lower limit on the processor time the work receives in every interval, given by a resource reservation §13.22 or by the work’s priority under a known scheduler.

  4. Bounded interference and blocking: limits on the time taken by interrupts §6.11 and higher-priority work, and on waits for lower-priority work that holds a lock or cannot be preempted.

  5. An analysis valid for exactly these premises, such as fixed-priority response-time analysis §19.4.7, which combines the bounds into a worst-case response time.

The deadline is guaranteed when that worst-case response time is at most the deadline.

For example, let requests arrive at least 10 ms apart, each need at most 1 ms of processor time, be the only work at the highest priority under a preemptive scheduler and share no lock with lower-priority work, and let interrupt handlers §6.12 take at most 0.5 ms in any 2 ms window. Each request then completes within 1+0.5=1.51 + 0.5 = 1.5 ms, which lies inside the 2 ms window, and no earlier request is still pending when it arrives.

Limits and common mistakes

Do not mix units. A budget counts processor time; a deadline counts elapsed time on a clock, and 10 ms of processor time can take far longer than 10 ms to deliver.

Check what the budget charges. Nested charges count the same work twice, for example an operation charged both to its caller’s budget and to its own, while time spent in queues or interrupt handlers may be charged to nobody. Name the measured quantity, and where charging starts and stops.

A budget still has a use. A resource cap protects other work from this work; only a resource reservation protects this work from others.

Questions answered

What turns a budget into a deadline guarantee?

A budget alone never becomes a deadline guarantee, because it caps how much processor time work may use and a cap permits arbitrarily slow service. A deadline guarantee needs, in addition: a bound on arrivals, so the backlog ahead of a request is bounded; a worst-case execution time bound for each request; a guaranteed minimum of service from the scheduler, through a reservation or a known priority; bounds on interference from interrupts and higher-priority work and on waits for lower-priority work; and a response-time analysis valid for exactly those premises. When the analysis gives a worst-case response time no larger than the deadline, the deadline is guaranteed for as long as every premise holds in the running system.

Related entries: Schedulability (§9.37), Rate limiting (§9.38), Queueing delay (§14.38), Resource cap versus resource reservation (§13.22), Worst-case execution time (WCET) (§9.33), Fixed-priority response-time analysis (§19.4.7).