Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dl doc #1

Merged
merged 6 commits into from
Jan 27, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 48 additions & 9 deletions Documentation/scheduler/sched-deadline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CONTENTS

0. WARNING
1. Overview
2. Task scheduling
2. Scheduling algorithm
3. Scheduling Real-Time Tasks
4. Bandwidth management
4.1 System-wide settings
Expand Down Expand Up @@ -34,7 +34,7 @@ CONTENTS
that makes it possible to isolate the behavior of tasks between each other.


2. Task scheduling
2. Scheduling algorithm
==================

SCHED_DEADLINE uses three parameters, named "runtime", "period", and
Expand All @@ -45,7 +45,9 @@ CONTENTS
every time the task wakes up, the scheduler computes a "scheduling deadline"
consistent with the guarantee (using the CBS[2,3] algorithm). Tasks are then
scheduled using EDF[1] on these scheduling deadlines (the task with the
smallest scheduling deadline is selected for execution).
smallest scheduling deadline is selected for execution). Notice that this
guaranteed is respected if a proper "admission control" strategy (see Section
"4. Bandwidth management") is used.

Summing up, the CBS[2,3] algorithms assigns scheduling deadlines to tasks so
that each task runs for at most its runtime every period, avoiding any
Expand All @@ -55,6 +57,42 @@ CONTENTS
strictly comply with the "traditional" real-time task model (see Section 3)
can effectively use the new policy.

In more details, the CBS algorithm assigns scheduling deadlines to
tasks in the following way:

- Each SCHED_DEADLINE task is characterised by the "runtime",
"deadline", and "period" parameters
- The state of the task is described by a "scheduling deadline", and
a "current runtime". These two parameters are initially set to 0
- When a SCHED_DEADLINE task wakes up (becomes ready for execution),
the scheduler checks if
current runtime runtime
---------------------------------- > ----------------
scheduling deadline - current time period
if the scheduling deadline is smaller than the current time, or
this condition is verified, then the scheduling deadline and the
current budget are re-initialised as
scheduling deadline = current time + deadline
current runtime = runtime
otherwise, the scheduling deadline and the current runtime are
left unchanged
- When a SCHED_DEADLINE task executes for an amount of time t, its
current runtime is decreased as
current runtime = current runtime - t
(technically, the runtime is decreased at every tick, or when the
task is descheduled / preempted)
- When the current runtime becomes less or equal than 0, the task is
said to be "throttled" (also known as "depleted" in real-time literature)
and cannot be scheduled until its scheduling deadline. The "replenishment
time" for this task (see next item) is set to be equal to the current
value of the scheduling deadline
- When the current time is equal to the replenishment time of a
throttled task, the scheduling deadline and the current runtime are
updated as
scheduling deadline = scheduling deadline + period
current runtime = current runtime + runtime


3. Scheduling Real-Time Tasks
=============================

Expand All @@ -70,11 +108,12 @@ CONTENTS

There are no limitations on what kind of task can exploit this new
scheduling discipline, even if it must be said that it is particularly
suited for periodic or sporadic tasks that need guarantees on their
suited for periodic or sporadic real-time tasks that need guarantees on their
timing behavior, e.g., multimedia, streaming, control applications, etc.

A typical real-time task is composed of a computation phase (task instance,
or job) which is activated on a periodic or sporadic fashion.
A typical real-time task is composed of a repetition of computation phases
(task instances, or jobs) which are activated on a periodic or sporadic
fashion.
Each job J_j (where J_j is the j^th job of the task) is characterised by an
arrival time r_j (the time when the job starts), an amount of computation
time c_j needed to finish the job, and a job absolute deadline d_j, which
Expand All @@ -93,9 +132,9 @@ CONTENTS
- period <= P

IOW, if runtime >= WCET and if period is >= P, then the scheduling deadlines
and the absolute deadlines (d_j) coincide, so the task is guaranteed to
respect the jobs' absolute deadlines (this is what is called "hard
schedulability property" in the CBS paper[2]).
and the absolute deadlines (d_j) coincide, so a proper admission control
allows to respect the jobs' absolute deadlines for this task (this is what is
called "hard schedulability property" and is an extension of Lemma 1 of [2]).

References:
1 - C. L. Liu and J. W. Layland. Scheduling algorithms for multiprogram-
Expand Down