“The Linux scheduler, in both the mainline and realtime
versions, provides a couple of scheduling classes for realtime
tasks. These classes implement the classic POSIX priority-based
semantics, wherein the highest-priority runnable task is guaranteed
to have access to the CPU. While this scheduler works as
advertised, priority-based scheduling has a number of problems and
has not been the focus of realtime research for some time. Cool
schedulers in this century are based on deadlines instead. Linux
does not yet have a deadline scheduler, though there is one in the
works. A recent discussion on implementing the full deadline model
has shown, once again, just how complex it can be to get deadline
scheduling right in the real world.“Deadline scheduling does away with priorities, replacing them
with a three-parameter tuple: a worst-case execution time (or
budget), a deadline, and a period. In essence, a process tells the
scheduler that it will require up to a certain amount of CPU time
(the budget) by the given deadline, and that the deadline
optionally repeats with the given period. So, for example, a
video-processing application might request 1ms of CPU time to
process the next incoming frame, expected in 10ms, with a 33ms
period thereafter for subsequent frames. Deadline scheduling is
appealing because it allows the specification of a process’s
requirements in a natural way which is not affected by any other
processes running in the system. There is also great value, though,
in using the deadline parameters to guarantee that a process will
be able to meet its deadline, and to reject any process which might
cause a failure to keep those guarantees.”
Adding periods to SCHED_DEADLINE
By
Jonathan Corbet
Get the Free Newsletter!
Subscribe to Developer Insider for top news, trends, & analysis