linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Luca Abeni <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	luca.abeni@unitn.it, mingo@kernel.org, tglx@linutronix.de,
	torvalds@linux-foundation.org, hpa@zytor.com
Subject: [tip:sched/core] sched/dl/Documentation: Add some notes on EDF schedulability
Date: Tue, 19 May 2015 00:25:07 -0700	[thread overview]
Message-ID: <tip-e0deda8142a60e4a39d5ba2ea47294a851b4309a@git.kernel.org> (raw)
In-Reply-To: <1431954032-16473-7-git-send-email-luca.abeni@unitn.it>

Commit-ID:  e0deda8142a60e4a39d5ba2ea47294a851b4309a
Gitweb:     http://git.kernel.org/tip/e0deda8142a60e4a39d5ba2ea47294a851b4309a
Author:     Luca Abeni <luca.abeni@unitn.it>
AuthorDate: Mon, 18 May 2015 15:00:29 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 19 May 2015 08:39:20 +0200

sched/dl/Documentation: Add some notes on EDF schedulability

Add a short discussion about sufficient and necessary schedulability tests,
and add a simple example showing that if D_i != P_i then density based tests
are only sufficient.

Also add some references to scientific papers on schedulability tests for
EDF that are both necessary and sufficient, and on their computational
complexity.

Signed-off-by: Luca Abeni <luca.abeni@unitn.it>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: henrik@austad.us
Cc: juri.lelli@gmail.com
Cc: raistlin@linux.it
Link: http://lkml.kernel.org/r/1431954032-16473-7-git-send-email-luca.abeni@unitn.it
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 Documentation/scheduler/sched-deadline.txt | 45 ++++++++++++++++++++++++++++--
 1 file changed, 42 insertions(+), 3 deletions(-)

diff --git a/Documentation/scheduler/sched-deadline.txt b/Documentation/scheduler/sched-deadline.txt
index c794ebf..bd4123b 100644
--- a/Documentation/scheduler/sched-deadline.txt
+++ b/Documentation/scheduler/sched-deadline.txt
@@ -137,6 +137,9 @@ CONTENTS
  A real-time task can be periodic with period P if r_{j+1} = r_j + P, or
  sporadic with minimum inter-arrival time P is r_{j+1} >= r_j + P. Finally,
  d_j = r_j + D, where D is the task's relative deadline.
+ Summing up, a real-time task can be described as
+	Task = (WCET, D, P)
+
  The utilization of a real-time task is defined as the ratio between its
  WCET and its period (or minimum inter-arrival time), and represents
  the fraction of CPU time needed to execute the task.
@@ -170,9 +173,35 @@ CONTENTS
  of the tasks running on such a CPU is smaller or equal than 1.
  If D_i != P_i for some task, then it is possible to define the density of
  a task as WCET_i/min{D_i,P_i}, and EDF is able to respect all the deadlines
- of all the tasks running on a CPU if the sum sum(WCET_i/min{D_i,P_i}) of the
- densities of the tasks running on such a CPU is smaller or equal than 1
- (notice that this condition is only sufficient, and not necessary).
+ of all the tasks running on a CPU if the sum of the densities of the tasks
+ running on such a CPU is smaller or equal than 1:
+	sum(WCET_i / min{D_i, P_i}) <= 1
+ It is important to notice that this condition is only sufficient, and not
+ necessary: there are task sets that are schedulable, but do not respect the
+ condition. For example, consider the task set {Task_1,Task_2} composed by
+ Task_1=(50ms,50ms,100ms) and Task_2=(10ms,100ms,100ms).
+ EDF is clearly able to schedule the two tasks without missing any deadline
+ (Task_1 is scheduled as soon as it is released, and finishes just in time
+ to respect its deadline; Task_2 is scheduled immediately after Task_1, hence
+ its response time cannot be larger than 50ms + 10ms = 60ms) even if
+	50 / min{50,100} + 10 / min{100, 100} = 50 / 50 + 10 / 100 = 1.1
+ Of course it is possible to test the exact schedulability of tasks with
+ D_i != P_i (checking a condition that is both sufficient and necessary),
+ but this cannot be done by comparing the total utilization or density with
+ a constant. Instead, the so called "processor demand" approach can be used,
+ computing the total amount of CPU time h(t) needed by all the tasks to
+ respect all of their deadlines in a time interval of size t, and comparing
+ such a time with the interval size t. If h(t) is smaller than t (that is,
+ the amount of time needed by the tasks in a time interval of size t is
+ smaller than the size of the interval) for all the possible values of t, then
+ EDF is able to schedule the tasks respecting all of their deadlines. Since
+ performing this check for all possible values of t is impossible, it has been
+ proven[4,5,6] that it is sufficient to perform the test for values of t
+ between 0 and a maximum value L. The cited papers contain all of the
+ mathematical details and explain how to compute h(t) and L.
+ In any case, this kind of analysis is too complex as well as too
+ time-consuming to be performed on-line. Hence, as explained in Section
+ 4 Linux uses an admission test based on the tasks' utilizations.
 
  On multiprocessor systems with global EDF scheduling (non partitioned
  systems), a sufficient test for schedulability can not be based on the
@@ -206,6 +235,16 @@ CONTENTS
       Symposium, 1998. http://retis.sssup.it/~giorgio/paps/1998/rtss98-cbs.pdf
   3 - L. Abeni. Server Mechanisms for Multimedia Applications. ReTiS Lab
       Technical Report. http://disi.unitn.it/~abeni/tr-98-01.pdf
+  4 - J. Y. Leung and M.L. Merril. A Note on Preemptive Scheduling of
+      Periodic, Real-Time Tasks. Information Processing Letters, vol. 11,
+      no. 3, pp. 115-118, 1980.
+  5 - S. K. Baruah, A. K. Mok and L. E. Rosier. Preemptively Scheduling
+      Hard-Real-Time Sporadic Tasks on One Processor. Proceedings of the
+      11th IEEE Real-time Systems Symposium, 1990.
+  6 - S. K. Baruah, L. E. Rosier and R. R. Howell. Algorithms and Complexity
+      Concerning the Preemptive Scheduling of Periodic Real-Time tasks on
+      One Processor. Real-Time Systems Journal, vol. 4, no. 2, pp 301-324,
+      1990.
 
 4. Bandwidth management
 =======================

  reply	other threads:[~2015-05-19  7:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 13:00 [PATCH 0/9] SCHED_DEADLINE documentation update Luca Abeni
2015-05-18 13:00 ` [PATCH 1/9] Documentation/scheduler/sched-deadline.txt: correct definition of density as C_i/min{D_i,P_i} Luca Abeni
2015-05-19  7:23   ` [tip:sched/core] sched/dl/Documentation: Correct the " tip-bot for Zhiqiang Zhang
2015-05-18 13:00 ` [PATCH 2/9] Documentation/scheduler/sched-deadline.txt: switch to American English Luca Abeni
2015-05-19  7:23   ` [tip:sched/core] sched/dl/Documentation: Switch " tip-bot for Luca Abeni
2015-05-18 13:00 ` [PATCH 3/9] Documentation/scheduler/sched-deadline.txt: fix typos Luca Abeni
2015-05-19  7:24   ` [tip:sched/core] sched/dl/Documentation: Fix typos tip-bot for Luca Abeni
2015-05-18 13:00 ` [PATCH 4/9] Documentation/scheduler/sched-deadline.txt: use consistent namings Luca Abeni
2015-05-19  7:24   ` [tip:sched/core] sched/dl/Documentation: Use consistent naming tip-bot for Luca Abeni
2015-05-18 13:00 ` [PATCH 5/9] Documentation/scheduler/sched-deadline.txt: remove _i from sum, max and min Luca Abeni
2015-05-19  7:24   ` [tip:sched/core] sched/dl/Documentation: Clarify indexing notation tip-bot for Luca Abeni
2015-05-18 13:00 ` [PATCH 6/9] Documentation/scheduler/sched-deadline.txt: Some notes on EDF schedulability Luca Abeni
2015-05-19  7:25   ` tip-bot for Luca Abeni [this message]
2015-05-18 13:00 ` [PATCH 7/9] Documentation/scheduler/sched-deadline.txt: add some references Luca Abeni
2015-05-19  7:25   ` [tip:sched/core] sched/dl/Documentation: Add " tip-bot for Luca Abeni
2015-05-18 13:00 ` [PATCH 8/9] Documentation/scheduler/sched-deadline.txt: relationship between tasks' deadlines and scheduling deadlines Luca Abeni
2015-05-19  7:25   ` [tip:sched/core] sched/dl/Documentation: Clarify the relationship between tasks' deadlines and absolute " tip-bot for Luca Abeni
2015-05-18 13:00 ` [PATCH 9/9] Documentation/scheduler/sched-deadline.txt: Split Section 3 Luca Abeni
2015-05-19  7:26   ` [tip:sched/core] sched/dl/Documentation: " tip-bot for Luca Abeni
2015-05-19 13:26 ` [PATCH 0/9] SCHED_DEADLINE documentation update Henrik Austad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-e0deda8142a60e4a39d5ba2ea47294a851b4309a@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luca.abeni@unitn.it \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).